/* Generated by Cython 0.25.2 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/home/jubatus/.pyenv/versions/local-system/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h", 
            "/home/jubatus/.pyenv/versions/local-system/local/lib/python2.7/site-packages/numpy/core/include/numpy/ufuncobject.h"
        ], 
        "include_dirs": [
            "/home/jubatus/.pyenv/versions/local-system/local/lib/python2.7/site-packages/numpy/core/include"
        ], 
        "language": "c++", 
        "libraries": [
            "jubatus_core", 
            "jubatus_util_text"
        ]
    }, 
    "module_name": "embedded_jubatus"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && 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_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #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
#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_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
#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_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
#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
#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
#ifndef METH_FASTCALL
  #define METH_FASTCALL 0x80
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
                                              Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
#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)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_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
#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
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if 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
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#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)

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


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

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#define __PYX_HAVE__embedded_jubatus
#define __PYX_HAVE_API__embedded_jubatus
#include <stdint.h>
#include <string.h>
#include <string>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <vector>
#include <utility>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "_wrapper.h"
#include "jubatus/core/fv_converter/datum.hpp"
#include "jubatus/core/classifier/classifier_type.hpp"
#include "jubatus/core/burst/burst.hpp"
#include "jubatus/core/bandit/arm_info.hpp"
#include "jubatus/util/lang/cast.h"
#include "jubatus/core/graph/graph_type.hpp"
#include "jubatus/core/clustering/types.hpp"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_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) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_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 PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

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


static const char *__pyx_f[] = {
  "src/embedded_jubatus.pyx",
  "src/types.pyx",
  "src/classifier.pyx",
  "src/anomaly.pyx",
  "src/bandit.pyx",
  "src/burst.pyx",
  "src/clustering.pyx",
  "src/nearest_neighbor.pyx",
  "src/recommender.pyx",
  "src/regression.pyx",
  "src/stat.pyx",
  "src/weight.pyx",
  "src/graph.pyx",
  "__init__.pxd",
  "stringsource",
  "type.pxd",
};
/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "_wrapper.pxd":10
 * ctypedef vector[pair[string, float]] sfv_t
 * ctypedef map[string, string] prop_t
 * ctypedef uint64_t edge_id_t             # <<<<<<<<<<<<<<
 * ctypedef uint64_t node_id_t
 * 
 */
typedef uint64_t __pyx_t_8_wrapper_edge_id_t;

/* "_wrapper.pxd":11
 * ctypedef map[string, string] prop_t
 * ctypedef uint64_t edge_id_t
 * ctypedef uint64_t node_id_t             # <<<<<<<<<<<<<<
 * 
 * cdef extern from '_wrapper.h' nogil:
 */
typedef uint64_t __pyx_t_8_wrapper_node_id_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_16embedded_jubatus__AnomalyWrapper;
struct __pyx_obj_16embedded_jubatus__BanditWrapper;
struct __pyx_obj_16embedded_jubatus__BurstWrapper;
struct __pyx_obj_16embedded_jubatus__ClassifierWrapper;
struct __pyx_obj_16embedded_jubatus__ClusteringWrapper;
struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper;
struct __pyx_obj_16embedded_jubatus__RecommenderWrapper;
struct __pyx_obj_16embedded_jubatus__RegressionWrapper;
struct __pyx_obj_16embedded_jubatus__StatWrapper;
struct __pyx_obj_16embedded_jubatus__WeightWrapper;
struct __pyx_obj_16embedded_jubatus__GraphWrapper;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init;
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* "_wrapper.pxd":8
 * from libcpp.map cimport map
 * 
 * ctypedef vector[pair[string, float]] sfv_t             # <<<<<<<<<<<<<<
 * ctypedef map[string, string] prop_t
 * ctypedef uint64_t edge_id_t
 */
typedef std::vector<std::pair<std::string,float> >  __pyx_t_8_wrapper_sfv_t;

/* "_wrapper.pxd":9
 * 
 * ctypedef vector[pair[string, float]] sfv_t
 * ctypedef map[string, string] prop_t             # <<<<<<<<<<<<<<
 * ctypedef uint64_t edge_id_t
 * ctypedef uint64_t node_id_t
 */
typedef std::map<std::string,std::string>  __pyx_t_8_wrapper_prop_t;

/* "src/anomaly.pyx":1
 * cdef class _AnomalyWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Anomaly *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__AnomalyWrapper {
  PyObject_HEAD
  _Anomaly *_handle;
};


/* "src/bandit.pyx":1
 * cdef class _BanditWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Bandit *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__BanditWrapper {
  PyObject_HEAD
  _Bandit *_handle;
};


/* "src/burst.pyx":12
 *     return {it.first.decode('utf8'): _to_window(it.second) for it in r}
 * 
 * cdef class _BurstWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Burst *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__BurstWrapper {
  PyObject_HEAD
  _Burst *_handle;
};


/* "src/classifier.pyx":1
 * cdef class _ClassifierWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Classifier *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__ClassifierWrapper {
  PyObject_HEAD
  _Classifier *_handle;
};


/* "src/clustering.pyx":1
 * cdef class _ClusteringWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Clustering *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__ClusteringWrapper {
  PyObject_HEAD
  _Clustering *_handle;
};


/* "src/nearest_neighbor.pyx":1
 * cdef class _NearestNeighborWrapper:             # <<<<<<<<<<<<<<
 *     cdef _NearestNeighbor *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper {
  PyObject_HEAD
  _NearestNeighbor *_handle;
};


/* "src/recommender.pyx":1
 * cdef class _RecommenderWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Recommender *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__RecommenderWrapper {
  PyObject_HEAD
  _Recommender *_handle;
};


/* "src/regression.pyx":1
 * cdef class _RegressionWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Regression *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__RegressionWrapper {
  PyObject_HEAD
  _Regression *_handle;
};


/* "src/stat.pyx":1
 * cdef class _StatWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Stat *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__StatWrapper {
  PyObject_HEAD
  _Stat *_handle;
};


/* "src/weight.pyx":1
 * cdef class _WeightWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Weight *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__WeightWrapper {
  PyObject_HEAD
  _Weight *_handle;
};


/* "src/graph.pyx":1
 * cdef class _GraphWrapper:             # <<<<<<<<<<<<<<
 *     cdef _Graph *_handle
 * 
 */
struct __pyx_obj_16embedded_jubatus__GraphWrapper {
  PyObject_HEAD
  _Graph *_handle;
};


/* "src/anomaly.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/bandit.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/burst.pyx":22
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/classifier.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/clustering.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/nearest_neighbor.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/recommender.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/regression.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/stat.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/weight.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* "src/graph.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1
 */
struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init {
  PyObject_HEAD
  struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self;
  PyObject *__pyx_v_typ;
  long __pyx_v_ver;
};


/* --- 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) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

/* 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) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

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

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

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

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

/* IncludeCppStringH.proto */
#include <string>

/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_cpp_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
         std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
}

/* BufferFormatCheck.proto */
static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type); // PROTO

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* 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

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

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

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

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

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

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

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

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

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

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

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

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

/* DictGetItem.proto */
#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;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(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

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

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

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

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

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

/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


/* None.proto */
static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

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

/* 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_Py_intptr_t(Py_intptr_t value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

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

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'libcpp' */

/* Module declarations from '_wrapper' */

/* Module declarations from 'embedded_jubatus' */
static PyTypeObject *__pyx_ptype_16embedded_jubatus__AnomalyWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__BanditWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__BurstWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__ClassifierWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__ClusteringWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__NearestNeighborWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__RecommenderWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__RegressionWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__StatWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__WeightWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus__GraphWrapper = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct___init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_1__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_2__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_3__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_4__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_5__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_6__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_7__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_8__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_9__init = 0;
static PyTypeObject *__pyx_ptype_16embedded_jubatus___pyx_scope_struct_10__init = 0;
static PyObject *__pyx_f_16embedded_jubatus_datum_py2native(PyObject *, jubatus::core::fv_converter::datum &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_datum_native2py(jubatus::core::fv_converter::datum &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_ndarray_to_datum(PyArrayObject *, int, jubatus::core::fv_converter::datum &, std::vector<std::string>  &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_csr_to_datum(PyArrayObject *, PyArrayObject *, PyArrayObject *, int, jubatus::core::fv_converter::datum &, std::vector<std::string>  &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_props_py2native(PyObject *, __pyx_t_8_wrapper_prop_t &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_props_native2py(__pyx_t_8_wrapper_prop_t &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_edges_native2py(std::vector<__pyx_t_8_wrapper_edge_id_t>  const &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus_preset_query_py2native(PyObject *, jubatus::core::graph::preset_query &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus__to_window(std::pair<double,std::vector<_Burst::Batch> >  const &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus__to_window_list(std::map<std::string,std::pair<double,std::vector<_Burst::Batch> > >  &); /*proto*/
static PyObject *__pyx_f_16embedded_jubatus__to_features(__pyx_t_8_wrapper_sfv_t &); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
#define __Pyx_MODULE_NAME "embedded_jubatus"
int __pyx_module_is_main_embedded_jubatus = 0;

/* Implementation of 'embedded_jubatus' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_ImportError;
static const char __pyx_k_X[] = "X";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_id[] = "id_";
static const char __pyx_k_rb[] = "rb";
static const char __pyx_k_wb[] = "wb";
static const char __pyx_k_cfg[] = "cfg";
static const char __pyx_k_dat[] = "dat";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_typ[] = "typ";
static const char __pyx_k_Edge[] = "Edge";
static const char __pyx_k_Node[] = "Node";
static const char __pyx_k_Stat[] = "Stat";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_id_2[] = "id";
static const char __pyx_k_init[] = "_init";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_stat[] = "stat";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_type[] = "_type";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_Batch[] = "Batch";
static const char __pyx_k_Burst[] = "Burst";
static const char __pyx_k_Datum[] = "Datum";
static const char __pyx_k_Graph[] = "Graph";
static const char __pyx_k_Query[] = "Query";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_burst[] = "burst";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_gamma[] = "gamma";
static const char __pyx_k_graph[] = "graph";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_point[] = "point";
static const char __pyx_k_props[] = "props";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_score[] = "score";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_to_id[] = "to_id";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_Bandit[] = "Bandit";
static const char __pyx_k_Weight[] = "Weight";
static const char __pyx_k_Window[] = "Window";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arm_id[] = "arm_id";
static const char __pyx_k_bandit[] = "bandit";
static const char __pyx_k_center[] = "center";
static const char __pyx_k_config[] = "config";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_degree[] = "degree";
static const char __pyx_k_do_mix[] = "do_mix";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_indptr[] = "indptr";
static const char __pyx_k_init_2[] = "__init__";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_reward[] = "reward";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_type_2[] = "type";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_Anomaly[] = "Anomaly";
static const char __pyx_k_ArmInfo[] = "ArmInfo";
static const char __pyx_k_Feature[] = "Feature";
static const char __pyx_k_anomaly[] = "anomaly";
static const char __pyx_k_classes[] = "classes_";
static const char __pyx_k_edge_id[] = "edge_id";
static const char __pyx_k_from_id[] = "from_id";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_keyword[] = "keyword";
static const char __pyx_k_max_hop[] = "max_hop";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_node_id[] = "node_id";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_Document[] = "Document";
static const char __pyx_k_get_name[] = "get_name";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_new_name[] = "new_name";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_set_name[] = "set_name";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_127_0_0_1[] = "127.0.0.1";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_player_id[] = "player_id";
static const char __pyx_k_sort_keys[] = "sort_keys";
static const char __pyx_k_Classifier[] = "Classifier";
static const char __pyx_k_Clustering[] = "Clustering";
static const char __pyx_k_Regression[] = "Regression";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_add_binary[] = "add_binary";
static const char __pyx_k_add_number[] = "add_number";
static const char __pyx_k_add_string[] = "add_string";
static const char __pyx_k_classifier[] = "classifier";
static const char __pyx_k_clear_impl[] = "_clear_impl";
static const char __pyx_k_clustering[] = "clustering";
static const char __pyx_k_csr_matrix[] = "csr_matrix";
static const char __pyx_k_edge_query[] = "edge_query";
static const char __pyx_k_get_client[] = "get_client";
static const char __pyx_k_get_config[] = "get_config";
static const char __pyx_k_get_status[] = "get_status";
static const char __pyx_k_load_bytes[] = "load_bytes";
static const char __pyx_k_node_query[] = "node_query";
static const char __pyx_k_num_values[] = "num_values";
static const char __pyx_k_regression[] = "regression";
static const char __pyx_k_save_bytes[] = "save_bytes";
static const char __pyx_k_IdWithScore[] = "IdWithScore";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_JubatusBase[] = "_JubatusBase";
static const char __pyx_k_PresetQuery[] = "PresetQuery";
static const char __pyx_k_Recommender[] = "Recommender";
static const char __pyx_k_ScoredDatum[] = "ScoredDatum";
static const char __pyx_k_host___port[] = "{host}_{port}";
static const char __pyx_k_partial_fit[] = "partial_fit";
static const char __pyx_k_recommender[] = "recommender";
static const char __pyx_k_LabeledDatum[] = "LabeledDatum";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_NNIdWithScore[] = "NNIdWithScore";
static const char __pyx_k_WeightedDatum[] = "WeightedDatum";
static const char __pyx_k_WeightedIndex[] = "WeightedIndex";
static const char __pyx_k_binary_values[] = "binary_values";
static const char __pyx_k_invalid_shape[] = "invalid shape";
static const char __pyx_k_scaling_param[] = "scaling_param";
static const char __pyx_k_string_values[] = "string_values";
static const char __pyx_k_EstimateResult[] = "EstimateResult";
static const char __pyx_k_get_model_path[] = "_get_model_path";
static const char __pyx_k_NearestNeighbor[] = "NearestNeighbor";
static const char __pyx_k_centrality_type[] = "centrality_type";
static const char __pyx_k_invalid_X_shape[] = "invalid X.shape";
static const char __pyx_k_JubatusBase_load[] = "_JubatusBase.load";
static const char __pyx_k_JubatusBase_save[] = "_JubatusBase.save";
static const char __pyx_k_embedded_jubatus[] = "embedded_jubatus";
static const char __pyx_k_get_proxy_status[] = "get_proxy_status";
static const char __pyx_k_nearest_neighbor[] = "nearest_neighbor";
static const char __pyx_k_JubatusBase_clear[] = "_JubatusBase.clear";
static const char __pyx_k_KeywordWithParams[] = "KeywordWithParams";
static const char __pyx_k_ShortestPathQuery[] = "ShortestPathQuery";
static const char __pyx_k_AnomalyIdWithScore[] = "AnomalyIdWithScore";
static const char __pyx_k_JubatusBase___init[] = "_JubatusBase.__init__";
static const char __pyx_k_JubatusBase_do_mix[] = "_JubatusBase.do_mix";
static const char __pyx_k_init_locals_lambda[] = "_init.<locals>.<lambda>";
static const char __pyx_k_jubatus_burst_types[] = "jubatus.burst.types";
static const char __pyx_k_jubatus_graph_types[] = "jubatus.graph.types";
static const char __pyx_k_JubatusBase_get_name[] = "_JubatusBase.get_name";
static const char __pyx_k_JubatusBase_set_name[] = "_JubatusBase.set_name";
static const char __pyx_k_jubatus_bandit_types[] = "jubatus.bandit.types";
static const char __pyx_k_jubatus_common_datum[] = "jubatus.common.datum";
static const char __pyx_k_jubatus_weight_types[] = "jubatus.weight.types";
static const char __pyx_k_jubatus_anomaly_types[] = "jubatus.anomaly.types";
static const char __pyx_k_JubatusBase___getstate[] = "_JubatusBase.__getstate__";
static const char __pyx_k_JubatusBase___setstate[] = "_JubatusBase.__setstate__";
static const char __pyx_k_JubatusBase_get_client[] = "_JubatusBase.get_client";
static const char __pyx_k_JubatusBase_get_status[] = "_JubatusBase.get_status";
static const char __pyx_k_RecommenderIdWithScore[] = "RecommenderIdWithScore";
static const char __pyx_k_jubatus_classifier_types[] = "jubatus.classifier.types";
static const char __pyx_k_jubatus_clustering_types[] = "jubatus.clustering.types";
static const char __pyx_k_jubatus_regression_types[] = "jubatus.regression.types";
static const char __pyx_k_jubatus_recommender_types[] = "jubatus.recommender.types";
static const char __pyx_k_JubatusBase__get_model_path[] = "_JubatusBase._get_model_path";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_JubatusBase_get_proxy_status[] = "_JubatusBase.get_proxy_status";
static const char __pyx_k_jubatus_nearest_neighbor_types[] = "jubatus.nearest_neighbor.types";
static const char __pyx_k_home_jubatus_Development_embedd[] = "/home/jubatus/Development/embedded-jubatus-python/src/embedded_jubatus.pyx";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_tmp_host___port___type___id_jub[] = "/tmp/{host}_{port}_{type}_{id}.jubatus";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_127_0_0_1;
static PyObject *__pyx_n_s_Anomaly;
static PyObject *__pyx_n_s_AnomalyIdWithScore;
static PyObject *__pyx_n_s_ArmInfo;
static PyObject *__pyx_n_s_Bandit;
static PyObject *__pyx_n_s_Batch;
static PyObject *__pyx_n_s_Burst;
static PyObject *__pyx_n_s_Classifier;
static PyObject *__pyx_n_s_Clustering;
static PyObject *__pyx_n_s_Datum;
static PyObject *__pyx_n_s_Document;
static PyObject *__pyx_n_s_Edge;
static PyObject *__pyx_n_s_EstimateResult;
static PyObject *__pyx_n_s_Feature;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_s_Graph;
static PyObject *__pyx_n_s_IdWithScore;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_JubatusBase;
static PyObject *__pyx_n_s_JubatusBase___getstate;
static PyObject *__pyx_n_s_JubatusBase___init;
static PyObject *__pyx_n_s_JubatusBase___setstate;
static PyObject *__pyx_n_s_JubatusBase__get_model_path;
static PyObject *__pyx_n_s_JubatusBase_clear;
static PyObject *__pyx_n_s_JubatusBase_do_mix;
static PyObject *__pyx_n_s_JubatusBase_get_client;
static PyObject *__pyx_n_s_JubatusBase_get_name;
static PyObject *__pyx_n_s_JubatusBase_get_proxy_status;
static PyObject *__pyx_n_s_JubatusBase_get_status;
static PyObject *__pyx_n_s_JubatusBase_load;
static PyObject *__pyx_n_s_JubatusBase_save;
static PyObject *__pyx_n_s_JubatusBase_set_name;
static PyObject *__pyx_n_s_KeywordWithParams;
static PyObject *__pyx_n_s_LabeledDatum;
static PyObject *__pyx_n_s_NNIdWithScore;
static PyObject *__pyx_n_s_NearestNeighbor;
static PyObject *__pyx_n_s_Node;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_PresetQuery;
static PyObject *__pyx_n_s_Query;
static PyObject *__pyx_n_s_Recommender;
static PyObject *__pyx_n_s_RecommenderIdWithScore;
static PyObject *__pyx_n_s_Regression;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_ScoredDatum;
static PyObject *__pyx_n_s_ShortestPathQuery;
static PyObject *__pyx_n_s_Stat;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_Weight;
static PyObject *__pyx_n_s_WeightedDatum;
static PyObject *__pyx_n_s_WeightedIndex;
static PyObject *__pyx_n_s_Window;
static PyObject *__pyx_n_s_X;
static PyObject *__pyx_n_s_add_binary;
static PyObject *__pyx_n_s_add_number;
static PyObject *__pyx_n_s_add_string;
static PyObject *__pyx_n_b_anomaly;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arm_id;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_b_bandit;
static PyObject *__pyx_n_s_binary_values;
static PyObject *__pyx_n_b_burst;
static PyObject *__pyx_n_s_center;
static PyObject *__pyx_n_s_centrality_type;
static PyObject *__pyx_n_s_cfg;
static PyObject *__pyx_n_s_classes;
static PyObject *__pyx_n_b_classifier;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clear_impl;
static PyObject *__pyx_n_b_clustering;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_csr_matrix;
static PyObject *__pyx_n_s_dat;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_degree;
static PyObject *__pyx_n_s_do_mix;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_edge_id;
static PyObject *__pyx_n_s_edge_query;
static PyObject *__pyx_n_s_embedded_jubatus;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_from_id;
static PyObject *__pyx_n_s_gamma;
static PyObject *__pyx_n_s_get_client;
static PyObject *__pyx_n_s_get_config;
static PyObject *__pyx_n_s_get_model_path;
static PyObject *__pyx_n_s_get_name;
static PyObject *__pyx_n_s_get_proxy_status;
static PyObject *__pyx_n_s_get_status;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_b_graph;
static PyObject *__pyx_kp_s_home_jubatus_Development_embedd;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_kp_s_host___port;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_id_2;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_indent;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_indptr;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_init_locals_lambda;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_kp_s_invalid_X_shape;
static PyObject *__pyx_kp_s_invalid_shape;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_jubatus_anomaly_types;
static PyObject *__pyx_n_s_jubatus_bandit_types;
static PyObject *__pyx_n_s_jubatus_burst_types;
static PyObject *__pyx_n_s_jubatus_classifier_types;
static PyObject *__pyx_n_s_jubatus_clustering_types;
static PyObject *__pyx_n_s_jubatus_common_datum;
static PyObject *__pyx_n_s_jubatus_graph_types;
static PyObject *__pyx_n_s_jubatus_nearest_neighbor_types;
static PyObject *__pyx_n_s_jubatus_recommender_types;
static PyObject *__pyx_n_s_jubatus_regression_types;
static PyObject *__pyx_n_s_jubatus_weight_types;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keyword;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_label;
static PyObject *__pyx_n_s_load;
static PyObject *__pyx_n_s_load_bytes;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max_hop;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_b_nearest_neighbor;
static PyObject *__pyx_n_s_new_name;
static PyObject *__pyx_n_s_node_id;
static PyObject *__pyx_n_s_node_query;
static PyObject *__pyx_n_s_num_values;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_partial_fit;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_player_id;
static PyObject *__pyx_n_s_point;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_props;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_query;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rb;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_b_recommender;
static PyObject *__pyx_n_b_regression;
static PyObject *__pyx_n_s_reward;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_save;
static PyObject *__pyx_n_s_save_bytes;
static PyObject *__pyx_n_s_scaling_param;
static PyObject *__pyx_n_s_score;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_sort_keys;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_b_stat;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_string_values;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_text;
static PyObject *__pyx_kp_s_tmp_host___port___type___id_jub;
static PyObject *__pyx_n_s_to_id;
static PyObject *__pyx_n_s_typ;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_2;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_wb;
static PyObject *__pyx_n_b_weight;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_2_get_model_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_4clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_8save(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_10get_status(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_12do_mix(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_14get_proxy_status(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_16get_name(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_18set_name(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_20get_client(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_22__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_24__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static int __pyx_pf_16embedded_jubatus_15_AnomalyWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_4_init(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_6clear_row(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_8add(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_10update(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_12overwrite(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_14calc_score(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_16get_all_rows(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self); /* proto */
static int __pyx_pf_16embedded_jubatus_14_BanditWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_14_BanditWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda7(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_4_init(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_6register_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_arm_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_8delete_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_arm_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_10select_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_12register_reward(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id, PyObject *__pyx_v_arm_id, PyObject *__pyx_v_reward); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_14get_arm_info(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_16reset(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id); /* proto */
static int __pyx_pf_16embedded_jubatus_13_BurstWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_13_BurstWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda8(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda11(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_4_init(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_6add_documents(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_8get_result(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_10get_result_at(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_12get_all_bursted_results(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_14get_all_bursted_results_at(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_16get_all_keywords(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_18add_keyword(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_20remove_keyword(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_22remove_all_keywords(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self); /* proto */
static int __pyx_pf_16embedded_jubatus_18_ClassifierWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda12(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_4_init(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_6train(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_8classify(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_10get_labels(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_12set_label(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_new_label); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_14delete_label(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_target_label); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_16fit(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_18partial_fit(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_20decision_function(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_22predict(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X); /* proto */
static int __pyx_pf_16embedded_jubatus_18_ClusteringWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda17(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda18(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_4_init(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_6push(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_8get_revision(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_10get_core_members(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_12get_k_center(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_14get_nearest_center(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_16get_nearest_members(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_18get_core_members_light(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_20get_nearest_members_light(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static int __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda22(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda23(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_4_init(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_6set_row(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_8neighbor_row_from_id(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_10neighbor_row_from_datum(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_12similar_row_from_id(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_14similar_row_from_datum(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_16get_all_rows(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self); /* proto */
static int __pyx_pf_16embedded_jubatus_19_RecommenderWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda24(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda25(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda26(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda27(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_4_init(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_6clear_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_8update_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_10complete_row_from_id(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_12complete_row_from_datum(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_14similar_row_from_id(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_16similar_row_from_datum(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_18decode_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_20get_all_rows(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_22calc_similarity(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_24calc_l2norm(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static int __pyx_pf_16embedded_jubatus_18_RegressionWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_18_RegressionWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda28(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda29(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda30(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda31(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_4_init(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_6train(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_8estimate(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static int __pyx_pf_16embedded_jubatus_12_StatWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_12_StatWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda32(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda33(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda34(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda35(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_4_init(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_6push(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_8sum(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_10stddev(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_12max(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_14min(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_16entropy(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_18moment(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_degree, PyObject *__pyx_v_center); /* proto */
static int __pyx_pf_16embedded_jubatus_14_WeightWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_14_WeightWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda36(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda37(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_4_init(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_6update(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_8calc_weight(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static int __pyx_pf_16embedded_jubatus_13_GraphWrapper___cinit__(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self); /* proto */
static void __pyx_pf_16embedded_jubatus_13_GraphWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda40(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda42(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda43(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_4_init(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_6create_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_8remove_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_10update_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_props); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_12create_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_14update_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_16remove_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_18get_centrality(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_centrality_type, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_20add_centrality_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_22add_shortest_path_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_24remove_centrality_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_26remove_shortest_path_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_28get_shortest_path(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_30update_index(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_32get_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id); /* proto */
static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_34get_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_16embedded_jubatus__AnomalyWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__BanditWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__BurstWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__ClassifierWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__ClusteringWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__NearestNeighborWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__RecommenderWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__RegressionWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__StatWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__WeightWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus__GraphWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct___init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_1__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_2__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_3__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_4__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_5__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_6__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_7__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_8__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_9__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_10__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_4;
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__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
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__20;
static PyObject *__pyx_tuple__21;
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__30;
static PyObject *__pyx_tuple__31;
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__40;
static PyObject *__pyx_tuple__41;
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__50;
static PyObject *__pyx_tuple__51;
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__60;
static PyObject *__pyx_tuple__61;
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__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;

/* "embedded_jubatus.pyx":62
 * 
 * class _JubatusBase(object):
 *     def __init__(self, config):             # <<<<<<<<<<<<<<
 *         import json
 *         if isinstance(config, str):
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_1__init__ = {"__init__", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_config = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_config,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_config)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 62, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 62, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_config = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 62, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase___init__(__pyx_self, __pyx_v_self, __pyx_v_config);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_v_typ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_config);

  /* "embedded_jubatus.pyx":63
 * class _JubatusBase(object):
 *     def __init__(self, config):
 *         import json             # <<<<<<<<<<<<<<
 *         if isinstance(config, str):
 *             # loads config from file
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":64
 *     def __init__(self, config):
 *         import json
 *         if isinstance(config, str):             # <<<<<<<<<<<<<<
 *             # loads config from file
 *             config = open(config, 'rb').read().decode('utf8')
 */
  __pyx_t_2 = PyString_Check(__pyx_v_config); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "embedded_jubatus.pyx":66
 *         if isinstance(config, str):
 *             # loads config from file
 *             config = open(config, 'rb').read().decode('utf8')             # <<<<<<<<<<<<<<
 *             # JSON parse test
 *             json.loads(config)
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_config);
    __Pyx_GIVEREF(__pyx_v_config);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_config);
    __Pyx_INCREF(__pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_rb);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "embedded_jubatus.pyx":68
 *             config = open(config, 'rb').read().decode('utf8')
 *             # JSON parse test
 *             json.loads(config)             # <<<<<<<<<<<<<<
 *         else:
 *             config = json.dumps(config, sort_keys=True, indent=4)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_config};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_config};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 68, __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_config);
        __Pyx_GIVEREF(__pyx_v_config);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_config);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "embedded_jubatus.pyx":64
 *     def __init__(self, config):
 *         import json
 *         if isinstance(config, str):             # <<<<<<<<<<<<<<
 *             # loads config from file
 *             config = open(config, 'rb').read().decode('utf8')
 */
    goto __pyx_L3;
  }

  /* "embedded_jubatus.pyx":70
 *             json.loads(config)
 *         else:
 *             config = json.dumps(config, sort_keys=True, indent=4)             # <<<<<<<<<<<<<<
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_dumps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_config);
    __Pyx_GIVEREF(__pyx_v_config);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_config);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_sort_keys, Py_True) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_indent, __pyx_int_4) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "embedded_jubatus.pyx":72
 *             config = json.dumps(config, sort_keys=True, indent=4)
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))             # <<<<<<<<<<<<<<
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
    PyObject* sequence = __pyx_t_5;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 71, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 71, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[5] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 71, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }

  /* "embedded_jubatus.pyx":71
 *         else:
 *             config = json.dumps(config, sort_keys=True, indent=4)
 *         (self.get_config, self.save_bytes, self.load_bytes,             # <<<<<<<<<<<<<<
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 *         if str != bytes and isinstance(typ, bytes):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_get_config, __pyx_t_6) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_save_bytes, __pyx_t_7) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_load_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":72
 *             config = json.dumps(config, sort_keys=True, indent=4)
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))             # <<<<<<<<<<<<<<
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clear_impl, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_typ = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "embedded_jubatus.pyx":73
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 *         if str != bytes and isinstance(typ, bytes):             # <<<<<<<<<<<<<<
 *             typ = typ.decode('ascii')
 *         self._type = typ
 */
  __pyx_t_5 = PyObject_RichCompare(((PyObject *)(&PyString_Type)), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_typ); 
  __pyx_t_11 = (__pyx_t_2 != 0);
  __pyx_t_3 = __pyx_t_11;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {

    /* "embedded_jubatus.pyx":74
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')             # <<<<<<<<<<<<<<
 *         self._type = typ
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_typ, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_typ, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "embedded_jubatus.pyx":73
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 *         if str != bytes and isinstance(typ, bytes):             # <<<<<<<<<<<<<<
 *             typ = typ.decode('ascii')
 *         self._type = typ
 */
  }

  /* "embedded_jubatus.pyx":75
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')
 *         self._type = typ             # <<<<<<<<<<<<<<
 * 
 *     def _get_model_path(self, id_):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type, __pyx_v_typ) < 0) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "embedded_jubatus.pyx":62
 * 
 * class _JubatusBase(object):
 *     def __init__(self, config):             # <<<<<<<<<<<<<<
 *         import json
 *         if isinstance(config, str):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XDECREF(__pyx_v_typ);
  __Pyx_XDECREF(__pyx_v_config);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":77
 *         self._type = typ
 * 
 *     def _get_model_path(self, id_):             # <<<<<<<<<<<<<<
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_3_get_model_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_3_get_model_path = {"_get_model_path", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_3_get_model_path, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_3_get_model_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_model_path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_model_path", 1, 2, 2, 1); __PYX_ERR(0, 77, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_model_path") < 0)) __PYX_ERR(0, 77, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_id_ = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_model_path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 77, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase._get_model_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_2_get_model_path(__pyx_self, __pyx_v_self, __pyx_v_id_);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_2_get_model_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_v_host = NULL;
  long __pyx_v_port;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_get_model_path", 0);

  /* "embedded_jubatus.pyx":78
 * 
 *     def _get_model_path(self, id_):
 *         host, port = '127.0.0.1', 0             # <<<<<<<<<<<<<<
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 *             host=host, port=port, type=self._type, id=id_)
 */
  __pyx_t_1 = __pyx_kp_s_127_0_0_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_v_host = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_port = __pyx_t_2;

  /* "embedded_jubatus.pyx":79
 *     def _get_model_path(self, id_):
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(             # <<<<<<<<<<<<<<
 *             host=host, port=port, type=self._type, id=id_)
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_tmp_host___port___type___id_jub, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "embedded_jubatus.pyx":80
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 *             host=host, port=port, type=self._type, id=id_)             # <<<<<<<<<<<<<<
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_host, __pyx_v_host) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type_2, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_id_2, __pyx_v_id_) < 0) __PYX_ERR(0, 80, __pyx_L1_error)

  /* "embedded_jubatus.pyx":79
 *     def _get_model_path(self, id_):
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(             # <<<<<<<<<<<<<<
 *             host=host, port=port, type=self._type, id=id_)
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":81
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 *             host=host, port=port, type=self._type, id=id_)
 *         return (path, '{host}_{port}'.format(host=host, port=port))             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_host___port, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_host, __pyx_v_host) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_port, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "embedded_jubatus.pyx":77
 *         self._type = typ
 * 
 *     def _get_model_path(self, id_):             # <<<<<<<<<<<<<<
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 */

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

/* "embedded_jubatus.pyx":83
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._clear_impl()
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_5clear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_5clear = {"clear", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_5clear, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_5clear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_4clear(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":84
 * 
 *     def clear(self):
 *         self._clear_impl()             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clear_impl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __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(0, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __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;

  /* "embedded_jubatus.pyx":85
 *     def clear(self):
 *         self._clear_impl()
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def load(self, id_):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "embedded_jubatus.pyx":83
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._clear_impl()
 *         return True
 */

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

/* "embedded_jubatus.pyx":87
 *         return True
 * 
 *     def load(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_7load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_7load = {"load", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_7load, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_7load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("load", 1, 2, 2, 1); __PYX_ERR(0, 87, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(0, 87, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_id_ = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_6load(__pyx_self, __pyx_v_self, __pyx_v_id_);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_v_path = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("load", 0);

  /* "embedded_jubatus.pyx":88
 * 
 *     def load(self, id_):
 *         path, name = self._get_model_path(id_)             # <<<<<<<<<<<<<<
 *         with open(path, 'rb') as f:
 *             self.load_bytes(f.read())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_model_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __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_id_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __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_id_};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __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_id_};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __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(0, 88, __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_id_);
      __Pyx_GIVEREF(__pyx_v_id_);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_id_);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 88, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 88, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_path = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":89
 *     def load(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             self.load_bytes(f.read())
 *         return True
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
    __Pyx_INCREF(__pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_rb);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L5_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(0, 89, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L5_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "embedded_jubatus.pyx":90
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:
 *             self.load_bytes(f.read())             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_load_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (__pyx_t_10) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L9_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
              __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L9_error)
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
              __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L9_error)
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            {
              __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 90, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "embedded_jubatus.pyx":89
 *     def load(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             self.load_bytes(f.read())
 *         return True
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L16_try_end;
        __pyx_L9_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("embedded_jubatus._JubatusBase.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_10) < 0) __PYX_ERR(0, 89, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 89, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 89, __pyx_L11_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_10);
            __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_10 = 0; 
            __PYX_ERR(0, 89, __pyx_L11_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L10_exception_handled;
        }
        __pyx_L11_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L10_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L16_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    goto __pyx_L20;
    __pyx_L5_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "embedded_jubatus.pyx":91
 *         with open(path, 'rb') as f:
 *             self.load_bytes(f.read())
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def save(self, id_):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "embedded_jubatus.pyx":87
 *         return True
 * 
 *     def load(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:
 */

  /* function 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_10);
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":93
 *         return True
 * 
 *     def save(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_9save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_9save = {"save", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_9save, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_9save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("save", 1, 2, 2, 1); __PYX_ERR(0, 93, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save") < 0)) __PYX_ERR(0, 93, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_id_ = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 93, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_8save(__pyx_self, __pyx_v_self, __pyx_v_id_);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_8save(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("save", 0);

  /* "embedded_jubatus.pyx":94
 * 
 *     def save(self, id_):
 *         path, name = self._get_model_path(id_)             # <<<<<<<<<<<<<<
 *         with open(path, 'wb') as f:
 *             f.write(self.save_bytes())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_model_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __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_id_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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_id_};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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_id_};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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(0, 94, __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_id_);
      __Pyx_GIVEREF(__pyx_v_id_);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_id_);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 94, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 94, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_path = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":95
 *     def save(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(self.save_bytes())
 *         return {name: path}
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
    __Pyx_INCREF(__pyx_n_s_wb);
    __Pyx_GIVEREF(__pyx_n_s_wb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_wb);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L5_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(0, 95, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L5_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "embedded_jubatus.pyx":96
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:
 *             f.write(self.save_bytes())             # <<<<<<<<<<<<<<
 *         return {name: path}
 * 
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_save_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (__pyx_t_10) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L9_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
              __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L9_error)
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
              __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L9_error)
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            {
              __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "embedded_jubatus.pyx":95
 *     def save(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(self.save_bytes())
 *         return {name: path}
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L16_try_end;
        __pyx_L9_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("embedded_jubatus._JubatusBase.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_10) < 0) __PYX_ERR(0, 95, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 95, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 95, __pyx_L11_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_10);
            __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_10 = 0; 
            __PYX_ERR(0, 95, __pyx_L11_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L10_exception_handled;
        }
        __pyx_L11_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L10_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L16_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    goto __pyx_L20;
    __pyx_L5_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "embedded_jubatus.pyx":97
 *         with open(path, 'wb') as f:
 *             f.write(self.save_bytes())
 *         return {name: path}             # <<<<<<<<<<<<<<
 * 
 *     def get_status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_v_name, __pyx_v_path) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "embedded_jubatus.pyx":93
 *         return True
 * 
 *     def save(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:
 */

  /* function 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_10);
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":99
 *         return {name: path}
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_11get_status(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_11get_status = {"get_status", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_11get_status, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_11get_status(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_status (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_10get_status(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":100
 * 
 *     def get_status(self):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def do_mix(self):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 100, __pyx_L1_error)

  /* "embedded_jubatus.pyx":99
 *         return {name: path}
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.get_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":102
 *         raise RuntimeError
 * 
 *     def do_mix(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_13do_mix(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_13do_mix = {"do_mix", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_13do_mix, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_13do_mix(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_mix (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_12do_mix(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":103
 * 
 *     def do_mix(self):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def get_proxy_status(self):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 103, __pyx_L1_error)

  /* "embedded_jubatus.pyx":102
 *         raise RuntimeError
 * 
 *     def do_mix(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.do_mix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":105
 *         raise RuntimeError
 * 
 *     def get_proxy_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_15get_proxy_status(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_15get_proxy_status = {"get_proxy_status", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_15get_proxy_status, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_15get_proxy_status(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_proxy_status (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_14get_proxy_status(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":106
 * 
 *     def get_proxy_status(self):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 106, __pyx_L1_error)

  /* "embedded_jubatus.pyx":105
 *         raise RuntimeError
 * 
 *     def get_proxy_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.get_proxy_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":108
 *         raise RuntimeError
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_17get_name(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_17get_name = {"get_name", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_17get_name, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_17get_name(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_16get_name(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":109
 * 
 *     def get_name(self):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def set_name(self, new_name):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 109, __pyx_L1_error)

  /* "embedded_jubatus.pyx":108
 *         raise RuntimeError
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":111
 *         raise RuntimeError
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_19set_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_19set_name = {"set_name", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_19set_name, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_19set_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_new_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_name (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_new_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_name", 1, 2, 2, 1); __PYX_ERR(0, 111, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_name") < 0)) __PYX_ERR(0, 111, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_new_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 111, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_18set_name(__pyx_self, __pyx_v_self, __pyx_v_new_name);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_18set_name(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_new_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_name", 0);

  /* "embedded_jubatus.pyx":112
 * 
 *     def set_name(self, new_name):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def get_client(self):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 112, __pyx_L1_error)

  /* "embedded_jubatus.pyx":111
 *         raise RuntimeError
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":114
 *         raise RuntimeError
 * 
 *     def get_client(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_21get_client(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_21get_client = {"get_client", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_21get_client, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_21get_client(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_client (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_20get_client(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":115
 * 
 *     def get_client(self):
 *         raise RuntimeError             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
  __PYX_ERR(0, 115, __pyx_L1_error)

  /* "embedded_jubatus.pyx":114
 *         raise RuntimeError
 * 
 *     def get_client(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.get_client", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "embedded_jubatus.pyx":117
 *         raise RuntimeError
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.get_config(), self.save_bytes())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_23__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_23__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_23__getstate__, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_23__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_22__getstate__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "embedded_jubatus.pyx":118
 * 
 *     def __getstate__(self):
 *         return (self.get_config(), self.save_bytes())             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __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(0, 118, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_save_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __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(0, 118, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "embedded_jubatus.pyx":117
 *         raise RuntimeError
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.get_config(), self.save_bytes())
 * 
 */

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

/* "embedded_jubatus.pyx":120
 *         return (self.get_config(), self.save_bytes())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         import json
 *         cfg, model = state
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_25__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_JubatusBase_25__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_16embedded_jubatus_12_JubatusBase_25__setstate__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_JubatusBase_25__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_state,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, 1); __PYX_ERR(0, 120, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setstate__") < 0)) __PYX_ERR(0, 120, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_state = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 120, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_JubatusBase_24__setstate__(__pyx_self, __pyx_v_self, __pyx_v_state);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_JubatusBase_24__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_v_cfg = NULL;
  PyObject *__pyx_v_model = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "embedded_jubatus.pyx":121
 * 
 *     def __setstate__(self, state):
 *         import json             # <<<<<<<<<<<<<<
 *         cfg, model = state
 *         self.__init__(json.loads(cfg))
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":122
 *     def __setstate__(self, state):
 *         import json
 *         cfg, model = state             # <<<<<<<<<<<<<<
 *         self.__init__(json.loads(cfg))
 *         self.load_bytes(model)
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 122, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 122, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_cfg = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_model = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":123
 *         import json
 *         cfg, model = state
 *         self.__init__(json.loads(cfg))             # <<<<<<<<<<<<<<
 *         self.load_bytes(model)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_cfg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_cfg};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_cfg};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_cfg);
      __Pyx_GIVEREF(__pyx_v_cfg);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_cfg);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __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_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __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(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __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;

  /* "embedded_jubatus.pyx":124
 *         cfg, model = state
 *         self.__init__(json.loads(cfg))
 *         self.load_bytes(model)             # <<<<<<<<<<<<<<
 * 
 * include 'types.pyx'
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_load_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  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);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_model); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __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_7, __pyx_v_model};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __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[2] = {__pyx_t_7, __pyx_v_model};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_model);
      __Pyx_GIVEREF(__pyx_v_model);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_model);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":120
 *         return (self.get_config(), self.save_bytes())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         import json
 *         cfg, model = state
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("embedded_jubatus._JubatusBase.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XDECREF(__pyx_v_cfg);
  __Pyx_XDECREF(__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":1
 * cdef datum_py2native(pd, datum& d):             # <<<<<<<<<<<<<<
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:
 */

static PyObject *__pyx_f_16embedded_jubatus_datum_py2native(PyObject *__pyx_v_pd, jubatus::core::fv_converter::datum &__pyx_v_d) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  std::string __pyx_t_9;
  std::string __pyx_t_10;
  std::pair<std::string,std::string>  __pyx_t_11;
  double __pyx_t_12;
  std::pair<std::string,double>  __pyx_t_13;
  __Pyx_RefNannySetupContext("datum_py2native", 0);

  /* "src/types.pyx":2
 * cdef datum_py2native(pd, datum& d):
 *     d.string_values_.clear()             # <<<<<<<<<<<<<<
 *     for k, v in pd.string_values:
 *         k = k.encode('utf8')
 */
  __pyx_v_d.string_values_.clear();

  /* "src/types.pyx":3
 * cdef datum_py2native(pd, datum& d):
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         v = v.encode('utf8')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_string_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 3, __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(1, 3, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 3, __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(1, 3, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 3, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 3, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 3, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "src/types.pyx":4
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         v = v.encode('utf8')
 *         d.string_values_.push_back(pair[string, string](k, v))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "src/types.pyx":5
 *     for k, v in pd.string_values:
 *         k = k.encode('utf8')
 *         v = v.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.string_values_.push_back(pair[string, string](k, v))
 *     d.num_values_.clear()
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":6
 *         k = k.encode('utf8')
 *         v = v.encode('utf8')
 *         d.string_values_.push_back(pair[string, string](k, v))             # <<<<<<<<<<<<<<
 *     d.num_values_.clear()
 *     for k, v in pd.num_values:
 */
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L1_error)
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_v_v); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L1_error)
    try {
      __pyx_t_11 = std::pair<std::string,std::string> (__pyx_t_9, __pyx_t_10);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 6, __pyx_L1_error)
    }
    try {
      __pyx_v_d.string_values_.push_back(__pyx_t_11);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 6, __pyx_L1_error)
    }

    /* "src/types.pyx":3
 * cdef datum_py2native(pd, datum& d):
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         v = v.encode('utf8')
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/types.pyx":7
 *         v = v.encode('utf8')
 *         d.string_values_.push_back(pair[string, string](k, v))
 *     d.num_values_.clear()             # <<<<<<<<<<<<<<
 *     for k, v in pd.num_values:
 *         k = k.encode('utf8')
 */
  __pyx_v_d.num_values_.clear();

  /* "src/types.pyx":8
 *         d.string_values_.push_back(pair[string, string](k, v))
 *     d.num_values_.clear()
 *     for k, v in pd.num_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         d.num_values_.push_back(pair[string, double](k, v))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_num_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 8, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 8, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 8, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 8, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 8, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "src/types.pyx":9
 *     d.num_values_.clear()
 *     for k, v in pd.num_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.num_values_.push_back(pair[string, double](k, v))
 *     d.binary_values_.clear()
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "src/types.pyx":10
 *     for k, v in pd.num_values:
 *         k = k.encode('utf8')
 *         d.num_values_.push_back(pair[string, double](k, v))             # <<<<<<<<<<<<<<
 *     d.binary_values_.clear()
 *     for k, v in pd.binary_values:
 */
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error)
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error)
    try {
      __pyx_t_13 = std::pair<std::string,double> (__pyx_t_10, __pyx_t_12);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 10, __pyx_L1_error)
    }
    try {
      __pyx_v_d.num_values_.push_back(__pyx_t_13);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 10, __pyx_L1_error)
    }

    /* "src/types.pyx":8
 *         d.string_values_.push_back(pair[string, string](k, v))
 *     d.num_values_.clear()
 *     for k, v in pd.num_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         d.num_values_.push_back(pair[string, double](k, v))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/types.pyx":11
 *         k = k.encode('utf8')
 *         d.num_values_.push_back(pair[string, double](k, v))
 *     d.binary_values_.clear()             # <<<<<<<<<<<<<<
 *     for k, v in pd.binary_values:
 *         k = k.encode('utf8')
 */
  __pyx_v_d.binary_values_.clear();

  /* "src/types.pyx":12
 *         d.num_values_.push_back(pair[string, double](k, v))
 *     d.binary_values_.clear()
 *     for k, v in pd.binary_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         d.binary_values_.push_back(pair[string, string](k, v))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_binary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 12, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 12, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 12, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 12, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 12, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "src/types.pyx":13
 *     d.binary_values_.clear()
 *     for k, v in pd.binary_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.binary_values_.push_back(pair[string, string](k, v))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "src/types.pyx":14
 *     for k, v in pd.binary_values:
 *         k = k.encode('utf8')
 *         d.binary_values_.push_back(pair[string, string](k, v))             # <<<<<<<<<<<<<<
 * 
 * cdef datum_native2py(datum& d):
 */
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 14, __pyx_L1_error)
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_v); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 14, __pyx_L1_error)
    try {
      __pyx_t_11 = std::pair<std::string,std::string> (__pyx_t_10, __pyx_t_9);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    try {
      __pyx_v_d.binary_values_.push_back(__pyx_t_11);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 14, __pyx_L1_error)
    }

    /* "src/types.pyx":12
 *         d.num_values_.push_back(pair[string, double](k, v))
 *     d.binary_values_.clear()
 *     for k, v in pd.binary_values:             # <<<<<<<<<<<<<<
 *         k = k.encode('utf8')
 *         d.binary_values_.push_back(pair[string, string](k, v))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "src/types.pyx":1
 * cdef datum_py2native(pd, datum& d):             # <<<<<<<<<<<<<<
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("embedded_jubatus.datum_py2native", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":16
 *         d.binary_values_.push_back(pair[string, string](k, v))
 * 
 * cdef datum_native2py(datum& d):             # <<<<<<<<<<<<<<
 *     ret = Datum()
 *     for i in range(d.string_values_.size()):
 */

static PyObject *__pyx_f_16embedded_jubatus_datum_native2py(jubatus::core::fv_converter::datum &__pyx_v_d) {
  PyObject *__pyx_v_ret = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("datum_native2py", 0);

  /* "src/types.pyx":17
 * 
 * cdef datum_native2py(datum& d):
 *     ret = Datum()             # <<<<<<<<<<<<<<
 *     for i in range(d.string_values_.size()):
 *         k = d.string_values_[i].first.decode('utf8')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Datum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __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, 17, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "src/types.pyx":18
 * cdef datum_native2py(datum& d):
 *     ret = Datum()
 *     for i in range(d.string_values_.size()):             # <<<<<<<<<<<<<<
 *         k = d.string_values_[i].first.decode('utf8')
 *         v = d.string_values_[i].second.decode('utf8')
 */
  __pyx_t_4 = __pyx_v_d.string_values_.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/types.pyx":19
 *     ret = Datum()
 *     for i in range(d.string_values_.size()):
 *         k = d.string_values_[i].first.decode('utf8')             # <<<<<<<<<<<<<<
 *         v = d.string_values_[i].second.decode('utf8')
 *         ret.add_string(k, v)
 */
    __pyx_t_1 = __Pyx_decode_cpp_string((__pyx_v_d.string_values_[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":20
 *     for i in range(d.string_values_.size()):
 *         k = d.string_values_[i].first.decode('utf8')
 *         v = d.string_values_[i].second.decode('utf8')             # <<<<<<<<<<<<<<
 *         ret.add_string(k, v)
 *     for i in range(d.num_values_.size()):
 */
    __pyx_t_1 = __Pyx_decode_cpp_string((__pyx_v_d.string_values_[__pyx_v_i]).second, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":21
 *         k = d.string_values_[i].first.decode('utf8')
 *         v = d.string_values_[i].second.decode('utf8')
 *         ret.add_string(k, v)             # <<<<<<<<<<<<<<
 *     for i in range(d.num_values_.size()):
 *         k = d.num_values_[i].first.decode('utf8')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ret, __pyx_n_s_add_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 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_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __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_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_k);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_v);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "src/types.pyx":22
 *         v = d.string_values_[i].second.decode('utf8')
 *         ret.add_string(k, v)
 *     for i in range(d.num_values_.size()):             # <<<<<<<<<<<<<<
 *         k = d.num_values_[i].first.decode('utf8')
 *         v = d.num_values_[i].second
 */
  __pyx_t_4 = __pyx_v_d.num_values_.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/types.pyx":23
 *         ret.add_string(k, v)
 *     for i in range(d.num_values_.size()):
 *         k = d.num_values_[i].first.decode('utf8')             # <<<<<<<<<<<<<<
 *         v = d.num_values_[i].second
 *         ret.add_number(k, v)
 */
    __pyx_t_1 = __Pyx_decode_cpp_string((__pyx_v_d.num_values_[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":24
 *     for i in range(d.num_values_.size()):
 *         k = d.num_values_[i].first.decode('utf8')
 *         v = d.num_values_[i].second             # <<<<<<<<<<<<<<
 *         ret.add_number(k, v)
 *     for i in range(d.binary_values_.size()):
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_d.num_values_[__pyx_v_i]).second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":25
 *         k = d.num_values_[i].first.decode('utf8')
 *         v = d.num_values_[i].second
 *         ret.add_number(k, v)             # <<<<<<<<<<<<<<
 *     for i in range(d.binary_values_.size()):
 *         k = d.binary_values_[i].first.decode('utf8')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ret, __pyx_n_s_add_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_k);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_v);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __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;
  }

  /* "src/types.pyx":26
 *         v = d.num_values_[i].second
 *         ret.add_number(k, v)
 *     for i in range(d.binary_values_.size()):             # <<<<<<<<<<<<<<
 *         k = d.binary_values_[i].first.decode('utf8')
 *         v = d.binary_values_[i].second
 */
  __pyx_t_4 = __pyx_v_d.binary_values_.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/types.pyx":27
 *         ret.add_number(k, v)
 *     for i in range(d.binary_values_.size()):
 *         k = d.binary_values_[i].first.decode('utf8')             # <<<<<<<<<<<<<<
 *         v = d.binary_values_[i].second
 *         ret.add_binary(k, v)
 */
    __pyx_t_1 = __Pyx_decode_cpp_string((__pyx_v_d.binary_values_[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":28
 *     for i in range(d.binary_values_.size()):
 *         k = d.binary_values_[i].first.decode('utf8')
 *         v = d.binary_values_[i].second             # <<<<<<<<<<<<<<
 *         ret.add_binary(k, v)
 *     return ret
 */
    __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string((__pyx_v_d.binary_values_[__pyx_v_i]).second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":29
 *         k = d.binary_values_[i].first.decode('utf8')
 *         v = d.binary_values_[i].second
 *         ret.add_binary(k, v)             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ret, __pyx_n_s_add_binary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 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_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __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_k, __pyx_v_v};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_k);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_v);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "src/types.pyx":30
 *         v = d.binary_values_[i].second
 *         ret.add_binary(k, v)
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * IF NUMPY:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/types.pyx":16
 *         d.binary_values_.push_back(pair[string, string](k, v))
 * 
 * cdef datum_native2py(datum& d):             # <<<<<<<<<<<<<<
 *     ret = Datum()
 *     for i in range(d.string_values_.size()):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("embedded_jubatus.datum_native2py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":34
 * IF NUMPY:
 * 
 *     cdef ndarray_to_datum(c_np.ndarray[c_np.float64_t, ndim=2] X, int i, datum& d, vector[string]& cache):             # <<<<<<<<<<<<<<
 *         d.string_values_.clear()
 *         d.num_values_.clear()
 */

static PyObject *__pyx_f_16embedded_jubatus_ndarray_to_datum(PyArrayObject *__pyx_v_X, int __pyx_v_i, jubatus::core::fv_converter::datum &__pyx_v_d, std::vector<std::string>  &__pyx_v_cache) {
  int __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_X;
  __Pyx_Buffer __pyx_pybuffer_X;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_intp __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  std::pair<std::string,double>  __pyx_t_9;
  __Pyx_RefNannySetupContext("ndarray_to_datum", 0);
  __pyx_pybuffer_X.pybuffer.buf = NULL;
  __pyx_pybuffer_X.refcount = 0;
  __pyx_pybuffernd_X.data = NULL;
  __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 34, __pyx_L1_error)
  }
  __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1];

  /* "src/types.pyx":35
 * 
 *     cdef ndarray_to_datum(c_np.ndarray[c_np.float64_t, ndim=2] X, int i, datum& d, vector[string]& cache):
 *         d.string_values_.clear()             # <<<<<<<<<<<<<<
 *         d.num_values_.clear()
 *         d.binary_values_.clear()
 */
  __pyx_v_d.string_values_.clear();

  /* "src/types.pyx":36
 *     cdef ndarray_to_datum(c_np.ndarray[c_np.float64_t, ndim=2] X, int i, datum& d, vector[string]& cache):
 *         d.string_values_.clear()
 *         d.num_values_.clear()             # <<<<<<<<<<<<<<
 *         d.binary_values_.clear()
 * 
 */
  __pyx_v_d.num_values_.clear();

  /* "src/types.pyx":37
 *         d.string_values_.clear()
 *         d.num_values_.clear()
 *         d.binary_values_.clear()             # <<<<<<<<<<<<<<
 * 
 *         cdef int j
 */
  __pyx_v_d.binary_values_.clear();

  /* "src/types.pyx":40
 * 
 *         cdef int j
 *         for j in range(cache.size(), X.shape[1]):             # <<<<<<<<<<<<<<
 *             cache.push_back(lexical_cast[string, int](j))
 *         for j in range(X.shape[1]):
 */
  __pyx_t_1 = (__pyx_v_X->dimensions[1]);
  for (__pyx_t_2 = __pyx_v_cache.size(); __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_j = __pyx_t_2;

    /* "src/types.pyx":41
 *         cdef int j
 *         for j in range(cache.size(), X.shape[1]):
 *             cache.push_back(lexical_cast[string, int](j))             # <<<<<<<<<<<<<<
 *         for j in range(X.shape[1]):
 *             if X[i, j] != 0.0:
 */
    try {
      __pyx_v_cache.push_back(jubatus::util::lang::lexical_cast<std::string,int>(__pyx_v_j));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 41, __pyx_L1_error)
    }
  }

  /* "src/types.pyx":42
 *         for j in range(cache.size(), X.shape[1]):
 *             cache.push_back(lexical_cast[string, int](j))
 *         for j in range(X.shape[1]):             # <<<<<<<<<<<<<<
 *             if X[i, j] != 0.0:
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))
 */
  __pyx_t_1 = (__pyx_v_X->dimensions[1]);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_j = __pyx_t_2;

    /* "src/types.pyx":43
 *             cache.push_back(lexical_cast[string, int](j))
 *         for j in range(X.shape[1]):
 *             if X[i, j] != 0.0:             # <<<<<<<<<<<<<<
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))
 * 
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = __pyx_v_j;
    __pyx_t_5 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_pybuffernd_X.diminfo[0].shape;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_X.diminfo[0].shape)) __pyx_t_5 = 0;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_pybuffernd_X.diminfo[1].shape;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
    } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_X.diminfo[1].shape)) __pyx_t_5 = 1;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(1, 43, __pyx_L1_error)
    }
    __pyx_t_6 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_X.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_X.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_X.diminfo[1].strides)) != 0.0) != 0);
    if (__pyx_t_6) {

      /* "src/types.pyx":44
 *         for j in range(X.shape[1]):
 *             if X[i, j] != 0.0:
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))             # <<<<<<<<<<<<<<
 * 
 *     cdef csr_to_datum(c_np.ndarray[c_np.float64_t, ndim=1] data,
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_t_8 = __pyx_v_j;
      __pyx_t_5 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_7 += __pyx_pybuffernd_X.diminfo[0].shape;
        if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_X.diminfo[0].shape)) __pyx_t_5 = 0;
      if (__pyx_t_8 < 0) {
        __pyx_t_8 += __pyx_pybuffernd_X.diminfo[1].shape;
        if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_X.diminfo[1].shape)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        __PYX_ERR(1, 44, __pyx_L1_error)
      }
      try {
        __pyx_t_9 = std::pair<std::string,double> ((__pyx_v_cache[__pyx_v_j]), (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_X.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_X.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_X.diminfo[1].strides)));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 44, __pyx_L1_error)
      }
      try {
        __pyx_v_d.num_values_.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 44, __pyx_L1_error)
      }

      /* "src/types.pyx":43
 *             cache.push_back(lexical_cast[string, int](j))
 *         for j in range(X.shape[1]):
 *             if X[i, j] != 0.0:             # <<<<<<<<<<<<<<
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))
 * 
 */
    }
  }

  /* "src/types.pyx":34
 * IF NUMPY:
 * 
 *     cdef ndarray_to_datum(c_np.ndarray[c_np.float64_t, ndim=2] X, int i, datum& d, vector[string]& cache):             # <<<<<<<<<<<<<<
 *         d.string_values_.clear()
 *         d.num_values_.clear()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_X.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("embedded_jubatus.ndarray_to_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_X.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":46
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))
 * 
 *     cdef csr_to_datum(c_np.ndarray[c_np.float64_t, ndim=1] data,             # <<<<<<<<<<<<<<
 *                       c_np.ndarray[c_np.int32_t, ndim=1] indices,
 *                       c_np.ndarray[c_np.int32_t, ndim=1] indptr,
 */

static PyObject *__pyx_f_16embedded_jubatus_csr_to_datum(PyArrayObject *__pyx_v_data, PyArrayObject *__pyx_v_indices, PyArrayObject *__pyx_v_indptr, int __pyx_v_i, jubatus::core::fv_converter::datum &__pyx_v_d, std::vector<std::string>  &__pyx_v_cache) {
  int __pyx_v_j;
  int __pyx_v_k;
  int __pyx_v_l;
  int __pyx_v_m;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_data;
  __Pyx_Buffer __pyx_pybuffer_data;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indptr;
  __Pyx_Buffer __pyx_pybuffer_indptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  long __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  std::pair<std::string,double>  __pyx_t_10;
  __Pyx_RefNannySetupContext("csr_to_datum", 0);
  __pyx_pybuffer_data.pybuffer.buf = NULL;
  __pyx_pybuffer_data.refcount = 0;
  __pyx_pybuffernd_data.data = NULL;
  __pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  __pyx_pybuffer_indptr.pybuffer.buf = NULL;
  __pyx_pybuffer_indptr.refcount = 0;
  __pyx_pybuffernd_indptr.data = NULL;
  __pyx_pybuffernd_indptr.rcbuffer = &__pyx_pybuffer_indptr;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 46, __pyx_L1_error)
  }
  __pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 46, __pyx_L1_error)
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 46, __pyx_L1_error)
  }
  __pyx_pybuffernd_indptr.diminfo[0].strides = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indptr.diminfo[0].shape = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.shape[0];

  /* "src/types.pyx":50
 *                       c_np.ndarray[c_np.int32_t, ndim=1] indptr,
 *                       int i, datum& d, vector[string]& cache):
 *         d.string_values_.clear()             # <<<<<<<<<<<<<<
 *         d.num_values_.clear()
 *         d.binary_values_.clear()
 */
  __pyx_v_d.string_values_.clear();

  /* "src/types.pyx":51
 *                       int i, datum& d, vector[string]& cache):
 *         d.string_values_.clear()
 *         d.num_values_.clear()             # <<<<<<<<<<<<<<
 *         d.binary_values_.clear()
 * 
 */
  __pyx_v_d.num_values_.clear();

  /* "src/types.pyx":52
 *         d.string_values_.clear()
 *         d.num_values_.clear()
 *         d.binary_values_.clear()             # <<<<<<<<<<<<<<
 * 
 *         cdef int j = indptr[i]
 */
  __pyx_v_d.binary_values_.clear();

  /* "src/types.pyx":54
 *         d.binary_values_.clear()
 * 
 *         cdef int j = indptr[i]             # <<<<<<<<<<<<<<
 *         cdef int k = indptr[i + 1]
 *         cdef int l, m
 */
  __pyx_t_1 = __pyx_v_i;
  __pyx_t_2 = -1;
  if (__pyx_t_1 < 0) {
    __pyx_t_1 += __pyx_pybuffernd_indptr.diminfo[0].shape;
    if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
  } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_indptr.diminfo[0].shape)) __pyx_t_2 = 0;
  if (unlikely(__pyx_t_2 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_2);
    __PYX_ERR(1, 54, __pyx_L1_error)
  }
  __pyx_v_j = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indptr.diminfo[0].strides));

  /* "src/types.pyx":55
 * 
 *         cdef int j = indptr[i]
 *         cdef int k = indptr[i + 1]             # <<<<<<<<<<<<<<
 *         cdef int l, m
 *         for l in range(j, k):
 */
  __pyx_t_3 = (__pyx_v_i + 1);
  __pyx_t_2 = -1;
  if (__pyx_t_3 < 0) {
    __pyx_t_3 += __pyx_pybuffernd_indptr.diminfo[0].shape;
    if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
  } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indptr.diminfo[0].shape)) __pyx_t_2 = 0;
  if (unlikely(__pyx_t_2 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_2);
    __PYX_ERR(1, 55, __pyx_L1_error)
  }
  __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indptr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indptr.diminfo[0].strides));

  /* "src/types.pyx":57
 *         cdef int k = indptr[i + 1]
 *         cdef int l, m
 *         for l in range(j, k):             # <<<<<<<<<<<<<<
 *             for m in range(cache.size(), indices[l] + 1):
 *                 cache.push_back(lexical_cast[string, int](m))
 */
  __pyx_t_2 = __pyx_v_k;
  for (__pyx_t_4 = __pyx_v_j; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
    __pyx_v_l = __pyx_t_4;

    /* "src/types.pyx":58
 *         cdef int l, m
 *         for l in range(j, k):
 *             for m in range(cache.size(), indices[l] + 1):             # <<<<<<<<<<<<<<
 *                 cache.push_back(lexical_cast[string, int](m))
 *             d.num_values_.push_back(pair[string, double](cache[indices[l]], data[l]))
 */
    __pyx_t_5 = __pyx_v_l;
    __pyx_t_6 = -1;
    if (__pyx_t_5 < 0) {
      __pyx_t_5 += __pyx_pybuffernd_indices.diminfo[0].shape;
      if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(1, 58, __pyx_L1_error)
    }
    __pyx_t_7 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_indices.diminfo[0].strides)) + 1);
    for (__pyx_t_6 = __pyx_v_cache.size(); __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
      __pyx_v_m = __pyx_t_6;

      /* "src/types.pyx":59
 *         for l in range(j, k):
 *             for m in range(cache.size(), indices[l] + 1):
 *                 cache.push_back(lexical_cast[string, int](m))             # <<<<<<<<<<<<<<
 *             d.num_values_.push_back(pair[string, double](cache[indices[l]], data[l]))
 * 
 */
      try {
        __pyx_v_cache.push_back(jubatus::util::lang::lexical_cast<std::string,int>(__pyx_v_m));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 59, __pyx_L1_error)
      }
    }

    /* "src/types.pyx":60
 *             for m in range(cache.size(), indices[l] + 1):
 *                 cache.push_back(lexical_cast[string, int](m))
 *             d.num_values_.push_back(pair[string, double](cache[indices[l]], data[l]))             # <<<<<<<<<<<<<<
 * 
 * ELSE:
 */
    __pyx_t_8 = __pyx_v_l;
    __pyx_t_6 = -1;
    if (__pyx_t_8 < 0) {
      __pyx_t_8 += __pyx_pybuffernd_indices.diminfo[0].shape;
      if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(1, 60, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_v_l;
    __pyx_t_6 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_pybuffernd_data.diminfo[0].shape;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_data.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(1, 60, __pyx_L1_error)
    }
    try {
      __pyx_t_10 = std::pair<std::string,double> ((__pyx_v_cache[(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indices.diminfo[0].strides))]), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_data.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_data.diminfo[0].strides)));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 60, __pyx_L1_error)
    }
    try {
      __pyx_v_d.num_values_.push_back(__pyx_t_10);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 60, __pyx_L1_error)
    }
  }

  /* "src/types.pyx":46
 *                 d.num_values_.push_back(pair[string, double](cache[j], X[i, j]))
 * 
 *     cdef csr_to_datum(c_np.ndarray[c_np.float64_t, ndim=1] data,             # <<<<<<<<<<<<<<
 *                       c_np.ndarray[c_np.int32_t, ndim=1] indices,
 *                       c_np.ndarray[c_np.int32_t, ndim=1] indptr,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("embedded_jubatus.csr_to_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":70
 *         raise RuntimeError
 * 
 * cdef props_py2native(p, prop_t& out):             # <<<<<<<<<<<<<<
 *     for k, v in p.items():
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 */

static PyObject *__pyx_f_16embedded_jubatus_props_py2native(PyObject *__pyx_v_p, __pyx_t_8_wrapper_prop_t &__pyx_v_out) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  std::string __pyx_t_9;
  std::string __pyx_t_10;
  std::pair<std::string,std::string>  __pyx_t_11;
  __Pyx_RefNannySetupContext("props_py2native", 0);

  /* "src/types.pyx":71
 * 
 * cdef props_py2native(p, prop_t& out):
 *     for k, v in p.items():             # <<<<<<<<<<<<<<
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __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, 71, __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, 71, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 71, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 71, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 71, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 71, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 71, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 71, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 71, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 71, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "src/types.pyx":72
 * cdef props_py2native(p, prop_t& out):
 *     for k, v in p.items():
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))             # <<<<<<<<<<<<<<
 * 
 * cdef props_native2py(prop_t& p):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    try {
      __pyx_t_11 = std::pair<std::string,std::string> (__pyx_t_9, __pyx_t_10);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 72, __pyx_L1_error)
    }
    try {
      __pyx_v_out.insert(__pyx_t_11);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 72, __pyx_L1_error)
    }

    /* "src/types.pyx":71
 * 
 * cdef props_py2native(p, prop_t& out):
 *     for k, v in p.items():             # <<<<<<<<<<<<<<
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/types.pyx":70
 *         raise RuntimeError
 * 
 * cdef props_py2native(p, prop_t& out):             # <<<<<<<<<<<<<<
 *     for k, v in p.items():
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("embedded_jubatus.props_py2native", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":74
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 * 
 * cdef props_native2py(prop_t& p):             # <<<<<<<<<<<<<<
 *     r = {}
 *     for it in p:
 */

static PyObject *__pyx_f_16embedded_jubatus_props_native2py(__pyx_t_8_wrapper_prop_t &__pyx_v_p) {
  PyObject *__pyx_v_r = NULL;
  std::pair<std::string,std::string>  __pyx_v_it;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::map<std::string,std::string> ::iterator __pyx_t_2;
  std::pair<std::string,std::string>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("props_native2py", 0);

  /* "src/types.pyx":75
 * 
 * cdef props_native2py(prop_t& p):
 *     r = {}             # <<<<<<<<<<<<<<
 *     for it in p:
 *         r[it.first.decode('utf8')] = it.second.decode('utf8')
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/types.pyx":76
 * cdef props_native2py(prop_t& p):
 *     r = {}
 *     for it in p:             # <<<<<<<<<<<<<<
 *         r[it.first.decode('utf8')] = it.second.decode('utf8')
 *     return r
 */
  __pyx_t_2 = __pyx_v_p.begin();
  for (;;) {
    if (!(__pyx_t_2 != __pyx_v_p.end())) break;
    __pyx_t_3 = *__pyx_t_2;
    ++__pyx_t_2;
    __pyx_v_it = __pyx_t_3;

    /* "src/types.pyx":77
 *     r = {}
 *     for it in p:
 *         r[it.first.decode('utf8')] = it.second.decode('utf8')             # <<<<<<<<<<<<<<
 *     return r
 * 
 */
    __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_it.second, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_decode_cpp_string(__pyx_v_it.first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_r, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "src/types.pyx":76
 * cdef props_native2py(prop_t& p):
 *     r = {}
 *     for it in p:             # <<<<<<<<<<<<<<
 *         r[it.first.decode('utf8')] = it.second.decode('utf8')
 *     return r
 */
  }

  /* "src/types.pyx":78
 *     for it in p:
 *         r[it.first.decode('utf8')] = it.second.decode('utf8')
 *     return r             # <<<<<<<<<<<<<<
 * 
 * cdef edges_native2py(const vector[edge_id_t]& edges):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_r);
  __pyx_r = __pyx_v_r;
  goto __pyx_L0;

  /* "src/types.pyx":74
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))
 * 
 * cdef props_native2py(prop_t& p):             # <<<<<<<<<<<<<<
 *     r = {}
 *     for it in p:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("embedded_jubatus.props_native2py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/types.pyx":80
 *     return r
 * 
 * cdef edges_native2py(const vector[edge_id_t]& edges):             # <<<<<<<<<<<<<<
 *     ret = []
 *     for i in range(edges.size()):
 */

static PyObject *__pyx_f_16embedded_jubatus_edges_native2py(std::vector<__pyx_t_8_wrapper_edge_id_t>  const &__pyx_v_edges) {
  PyObject *__pyx_v_ret = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("edges_native2py", 0);

  /* "src/types.pyx":81
 * 
 * cdef edges_native2py(const vector[edge_id_t]& edges):
 *     ret = []             # <<<<<<<<<<<<<<
 *     for i in range(edges.size()):
 *         ret.append(edges[i])
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/types.pyx":82
 * cdef edges_native2py(const vector[edge_id_t]& edges):
 *     ret = []
 *     for i in range(edges.size()):             # <<<<<<<<<<<<<<
 *         ret.append(edges[i])
 *     return ret
 */
  __pyx_t_2 = __pyx_v_edges.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/types.pyx":83
 *     ret = []
 *     for i in range(edges.size()):
 *         ret.append(edges[i])             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_uint64_t((__pyx_v_edges[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 83, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "src/types.pyx":84
 *     for i in range(edges.size()):
 *         ret.append(edges[i])
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * cdef preset_query_py2native(query, preset_query& q):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/types.pyx":80
 *     return r
 * 
 * cdef edges_native2py(const vector[edge_id_t]& edges):             # <<<<<<<<<<<<<<
 *     ret = []
 *     for i in range(edges.size()):
 */

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

/* "src/types.pyx":86
 *     return ret
 * 
 * cdef preset_query_py2native(query, preset_query& q):             # <<<<<<<<<<<<<<
 *     for x in query.edge_query:
 *         q.edge_query.push_back(pair[string, string](
 */

static PyObject *__pyx_f_16embedded_jubatus_preset_query_py2native(PyObject *__pyx_v_query, jubatus::core::graph::preset_query &__pyx_v_q) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  std::pair<std::string,std::string>  __pyx_t_8;
  __Pyx_RefNannySetupContext("preset_query_py2native", 0);

  /* "src/types.pyx":87
 * 
 * cdef preset_query_py2native(query, preset_query& q):
 *     for x in query.edge_query:             # <<<<<<<<<<<<<<
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_edge_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 87, __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(1, 87, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 87, __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(1, 87, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 87, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "src/types.pyx":89
 *     for x in query.edge_query:
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))             # <<<<<<<<<<<<<<
 *     for x in query.node_query:
 *         q.node_query.push_back(pair[string, string](
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_from_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_to_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "src/types.pyx":88
 * cdef preset_query_py2native(query, preset_query& q):
 *     for x in query.edge_query:
 *         q.edge_query.push_back(pair[string, string](             # <<<<<<<<<<<<<<
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 *     for x in query.node_query:
 */
    try {
      __pyx_t_8 = std::pair<std::string,std::string> (__pyx_t_6, __pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 88, __pyx_L1_error)
    }
    try {
      __pyx_v_q.edge_query.push_back(__pyx_t_8);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 88, __pyx_L1_error)
    }

    /* "src/types.pyx":87
 * 
 * cdef preset_query_py2native(query, preset_query& q):
 *     for x in query.edge_query:             # <<<<<<<<<<<<<<
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/types.pyx":90
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 *     for x in query.node_query:             # <<<<<<<<<<<<<<
 *         q.node_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_node_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 90, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 90, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 90, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 90, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "src/types.pyx":92
 *     for x in query.node_query:
 *         q.node_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))             # <<<<<<<<<<<<<<
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_from_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_to_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "src/types.pyx":91
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 *     for x in query.node_query:
 *         q.node_query.push_back(pair[string, string](             # <<<<<<<<<<<<<<
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 */
    try {
      __pyx_t_8 = std::pair<std::string,std::string> (__pyx_t_7, __pyx_t_6);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 91, __pyx_L1_error)
    }
    try {
      __pyx_v_q.node_query.push_back(__pyx_t_8);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 91, __pyx_L1_error)
    }

    /* "src/types.pyx":90
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 *     for x in query.node_query:             # <<<<<<<<<<<<<<
 *         q.node_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/types.pyx":86
 *     return ret
 * 
 * cdef preset_query_py2native(query, preset_query& q):             # <<<<<<<<<<<<<<
 *     for x in query.edge_query:
 *         q.edge_query.push_back(pair[string, string](
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("embedded_jubatus.preset_query_py2native", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/anomaly.pyx":4
 *     cdef _Anomaly *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_15_AnomalyWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_15_AnomalyWrapper_1__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_16embedded_jubatus_15_AnomalyWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self));

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

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

  /* "src/anomaly.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/anomaly.pyx":4
 *     cdef _Anomaly *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/anomaly.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_15_AnomalyWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_15_AnomalyWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/anomaly.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/anomaly.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/anomaly.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/anomaly.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/anomaly.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/anomaly.pyx":15
 *         typ, ver = b'anomaly', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_lambda = {"lambda", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_lambda, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(3, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/anomaly.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_1lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_1lambda1 = {"lambda1", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_1lambda1, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_1lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(3, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(3, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __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("embedded_jubatus._AnomalyWrapper._init.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/anomaly.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_2lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_2lambda2 = {"lambda2", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_2lambda2, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_2lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda2", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(3, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(3, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._AnomalyWrapper._init.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/anomaly.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_3lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_3lambda3 = {"lambda3", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_3lambda3, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init_3lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(3, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/anomaly.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_4_init(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Anomaly *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct___init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct___init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 11, __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);

  /* "src/anomaly.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Anomaly(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'anomaly', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Anomaly(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/anomaly.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_anomaly;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/anomaly.pyx":14
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/anomaly.pyx":15
 *         typ, ver = b'anomaly', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_lambda, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/anomaly.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_1lambda1, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/anomaly.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_2lambda2, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/anomaly.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_15_AnomalyWrapper_5_init_3lambda3, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/anomaly.pyx":15
 *         typ, ver = b'anomaly', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/anomaly.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Anomaly(config)
 *         typ, ver = b'anomaly', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._AnomalyWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/anomaly.pyx":22
 *         )
 * 
 *     def clear_row(self, id_):             # <<<<<<<<<<<<<<
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_7clear_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_7clear_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_row (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_6clear_row(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_id_));

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_6clear_row(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("clear_row", 0);

  /* "src/anomaly.pyx":23
 * 
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_handle->clear_row(__pyx_t_3);

  /* "src/anomaly.pyx":24
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def add(self, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/anomaly.pyx":22
 *         )
 * 
 *     def clear_row(self, id_):             # <<<<<<<<<<<<<<
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True
 */

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

/* "src/anomaly.pyx":26
 *         return True
 * 
 *     def add(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef pair[string, float] r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_9add(PyObject *__pyx_v_self, PyObject *__pyx_v_row); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_9add(PyObject *__pyx_v_self, PyObject *__pyx_v_row) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_8add(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_row));

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_8add(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::pair<std::string,float>  __pyx_v_r;
  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;
  __Pyx_RefNannySetupContext("add", 0);

  /* "src/anomaly.pyx":29
 *         cdef datum d
 *         cdef pair[string, float] r
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.add(d)
 *         return AnomalyIdWithScore(r.first.decode('utf8'), r.second)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/anomaly.pyx":30
 *         cdef pair[string, float] r
 *         datum_py2native(row, d)
 *         r = self._handle.add(d)             # <<<<<<<<<<<<<<
 *         return AnomalyIdWithScore(r.first.decode('utf8'), r.second)
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->add(__pyx_v_d);

  /* "src/anomaly.pyx":31
 *         datum_py2native(row, d)
 *         r = self._handle.add(d)
 *         return AnomalyIdWithScore(r.first.decode('utf8'), r.second)             # <<<<<<<<<<<<<<
 * 
 *     def update(self, id_, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AnomalyIdWithScore); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_decode_cpp_string(__pyx_v_r.first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_r.second); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 31, __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_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/anomaly.pyx":26
 *         return True
 * 
 *     def add(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef pair[string, float] r
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("embedded_jubatus._AnomalyWrapper.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/anomaly.pyx":33
 *         return AnomalyIdWithScore(r.first.decode('utf8'), r.second)
 * 
 *     def update(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_11update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_11update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_row,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, 1); __PYX_ERR(3, 33, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(3, 33, __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_id_ = values[0];
    __pyx_v_row = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 33, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._AnomalyWrapper.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_10update(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_row);

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_10update(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("update", 0);

  /* "src/anomaly.pyx":35
 *     def update(self, id_, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         return self._handle.update(id_.encode('utf8'), d)
 * 
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/anomaly.pyx":36
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.update(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 * 
 *     def overwrite(self, id_, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->update(__pyx_t_3, __pyx_v_d)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/anomaly.pyx":33
 *         return AnomalyIdWithScore(r.first.decode('utf8'), r.second)
 * 
 *     def update(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/anomaly.pyx":38
 *         return self._handle.update(id_.encode('utf8'), d)
 * 
 *     def overwrite(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_13overwrite(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_13overwrite(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("overwrite (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_row,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("overwrite", 1, 2, 2, 1); __PYX_ERR(3, 38, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "overwrite") < 0)) __PYX_ERR(3, 38, __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_id_ = values[0];
    __pyx_v_row = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("overwrite", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 38, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._AnomalyWrapper.overwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_12overwrite(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_row);

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_12overwrite(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("overwrite", 0);

  /* "src/anomaly.pyx":40
 *     def overwrite(self, id_, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         return self._handle.overwrite(id_.encode('utf8'), d)
 * 
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/anomaly.pyx":41
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.overwrite(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 * 
 *     def calc_score(self, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->overwrite(__pyx_t_3, __pyx_v_d)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/anomaly.pyx":38
 *         return self._handle.update(id_.encode('utf8'), d)
 * 
 *     def overwrite(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/anomaly.pyx":43
 *         return self._handle.overwrite(id_.encode('utf8'), d)
 * 
 *     def calc_score(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_15calc_score(PyObject *__pyx_v_self, PyObject *__pyx_v_row); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_15calc_score(PyObject *__pyx_v_self, PyObject *__pyx_v_row) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calc_score (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_14calc_score(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_row));

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_14calc_score(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("calc_score", 0);

  /* "src/anomaly.pyx":45
 *     def calc_score(self, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         return self._handle.calc_score(d)
 * 
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/anomaly.pyx":46
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.calc_score(d)             # <<<<<<<<<<<<<<
 * 
 *     def get_all_rows(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_handle->calc_score(__pyx_v_d)); 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;

  /* "src/anomaly.pyx":43
 *         return self._handle.overwrite(id_.encode('utf8'), d)
 * 
 *     def calc_score(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/anomaly.pyx":48
 *         return self._handle.calc_score(d)
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_17get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_17get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_rows (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_15_AnomalyWrapper_16get_all_rows(((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_15_AnomalyWrapper_16get_all_rows(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_all_rows", 0);

  /* "src/anomaly.pyx":49
 * 
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()             # <<<<<<<<<<<<<<
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */
  __pyx_v_ret = __pyx_v_self->_handle->get_all_rows();

  /* "src/anomaly.pyx":50
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __Pyx_decode_cpp_string(((std::string)(__pyx_v_ret[__pyx_v_i])), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/anomaly.pyx":48
 *         return self._handle.calc_score(d)
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

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

/* "src/bandit.pyx":4
 *     cdef _Bandit *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_14_BanditWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_14_BanditWrapper_1__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_16embedded_jubatus_14_BanditWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self));

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

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

  /* "src/bandit.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/bandit.pyx":4
 *     cdef _Bandit *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/bandit.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_14_BanditWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_14_BanditWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_14_BanditWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_14_BanditWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/bandit.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/bandit.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/bandit.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/bandit.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/bandit.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/bandit.pyx":15
 *         typ, ver = b'bandit', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_lambda4 = {"lambda4", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_lambda4, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/bandit.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_1lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_1lambda5 = {"lambda5", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_1lambda5, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_1lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda5", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(4, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __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("embedded_jubatus._BanditWrapper._init.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/bandit.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_2lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_2lambda6 = {"lambda6", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_2lambda6, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_2lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda6", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(4, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._BanditWrapper._init.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/bandit.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_3lambda7(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_3lambda7 = {"lambda7", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_3lambda7, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init_3lambda7(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda7(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda7", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/bandit.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_4_init(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Bandit *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_1__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_1__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 11, __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);

  /* "src/bandit.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Bandit(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'bandit', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Bandit(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/bandit.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_bandit;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/bandit.pyx":14
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/bandit.pyx":15
 *         typ, ver = b'bandit', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_lambda4, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/bandit.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_1lambda5, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/bandit.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_2lambda6, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/bandit.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_BanditWrapper_5_init_3lambda7, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/bandit.pyx":15
 *         typ, ver = b'bandit', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Bandit(config)
 *         typ, ver = b'bandit', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._BanditWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/bandit.pyx":22
 *         )
 * 
 *     def register_arm(self, arm_id):             # <<<<<<<<<<<<<<
 *         return self._handle.register_arm(arm_id.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_7register_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_arm_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_7register_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_arm_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_arm (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_6register_arm(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_arm_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_6register_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_arm_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("register_arm", 0);

  /* "src/bandit.pyx":23
 * 
 *     def register_arm(self, arm_id):
 *         return self._handle.register_arm(arm_id.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def delete_arm(self, arm_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arm_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->register_arm(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":22
 *         )
 * 
 *     def register_arm(self, arm_id):             # <<<<<<<<<<<<<<
 *         return self._handle.register_arm(arm_id.encode('utf8'))
 * 
 */

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

/* "src/bandit.pyx":25
 *         return self._handle.register_arm(arm_id.encode('utf8'))
 * 
 *     def delete_arm(self, arm_id):             # <<<<<<<<<<<<<<
 *         return self._handle.delete_arm(arm_id.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_9delete_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_arm_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_9delete_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_arm_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_arm (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_8delete_arm(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_arm_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_8delete_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_arm_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("delete_arm", 0);

  /* "src/bandit.pyx":26
 * 
 *     def delete_arm(self, arm_id):
 *         return self._handle.delete_arm(arm_id.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def select_arm(self, player_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arm_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->delete_arm(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":25
 *         return self._handle.register_arm(arm_id.encode('utf8'))
 * 
 *     def delete_arm(self, arm_id):             # <<<<<<<<<<<<<<
 *         return self._handle.delete_arm(arm_id.encode('utf8'))
 * 
 */

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

/* "src/bandit.pyx":28
 *         return self._handle.delete_arm(arm_id.encode('utf8'))
 * 
 *     def select_arm(self, player_id):             # <<<<<<<<<<<<<<
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_11select_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_11select_arm(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select_arm (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_10select_arm(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_player_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_10select_arm(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("select_arm", 0);

  /* "src/bandit.pyx":29
 * 
 *     def select_arm(self, player_id):
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')             # <<<<<<<<<<<<<<
 * 
 *     def register_reward(self, player_id, arm_id, reward):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_player_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_self->_handle->select_arm(__pyx_t_3), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":28
 *         return self._handle.delete_arm(arm_id.encode('utf8'))
 * 
 *     def select_arm(self, player_id):             # <<<<<<<<<<<<<<
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')
 * 
 */

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

/* "src/bandit.pyx":31
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')
 * 
 *     def register_reward(self, player_id, arm_id, reward):             # <<<<<<<<<<<<<<
 *         return self._handle.register_reward(
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_13register_reward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_13register_reward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_player_id = 0;
  PyObject *__pyx_v_arm_id = 0;
  PyObject *__pyx_v_reward = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_reward (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_player_id,&__pyx_n_s_arm_id,&__pyx_n_s_reward,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_player_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arm_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_reward", 1, 3, 3, 1); __PYX_ERR(4, 31, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reward)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_reward", 1, 3, 3, 2); __PYX_ERR(4, 31, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_reward") < 0)) __PYX_ERR(4, 31, __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_player_id = values[0];
    __pyx_v_arm_id = values[1];
    __pyx_v_reward = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_reward", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 31, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._BanditWrapper.register_reward", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_12register_reward(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), __pyx_v_player_id, __pyx_v_arm_id, __pyx_v_reward);

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_12register_reward(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id, PyObject *__pyx_v_arm_id, PyObject *__pyx_v_reward) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  std::string __pyx_t_4;
  double __pyx_t_5;
  __Pyx_RefNannySetupContext("register_reward", 0);

  /* "src/bandit.pyx":32
 * 
 *     def register_reward(self, player_id, arm_id, reward):
 *         return self._handle.register_reward(             # <<<<<<<<<<<<<<
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/bandit.pyx":33
 *     def register_reward(self, player_id, arm_id, reward):
 *         return self._handle.register_reward(
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)             # <<<<<<<<<<<<<<
 * 
 *     def get_arm_info(self, player_id):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_player_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arm_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_reward); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(4, 33, __pyx_L1_error)

  /* "src/bandit.pyx":32
 * 
 *     def register_reward(self, player_id, arm_id, reward):
 *         return self._handle.register_reward(             # <<<<<<<<<<<<<<
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->register_reward(__pyx_t_3, __pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":31
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')
 * 
 *     def register_reward(self, player_id, arm_id, reward):             # <<<<<<<<<<<<<<
 *         return self._handle.register_reward(
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 */

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

/* "src/bandit.pyx":35
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 * 
 *     def get_arm_info(self, player_id):             # <<<<<<<<<<<<<<
 *         cdef map[string, arm_info] r
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_15get_arm_info(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_15get_arm_info(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_arm_info (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_14get_arm_info(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_player_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_14get_arm_info(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id) {
  std::map<std::string,jubatus::core::bandit::arm_info>  __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  std::map<std::string,jubatus::core::bandit::arm_info> ::iterator __pyx_t_4;
  std::pair<std::string,jubatus::core::bandit::arm_info>  __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("get_arm_info", 0);

  /* "src/bandit.pyx":37
 *     def get_arm_info(self, player_id):
 *         cdef map[string, arm_info] r
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return {
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_player_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_r = __pyx_v_self->_handle->get_arm_info(__pyx_t_3);

  /* "src/bandit.pyx":38
 *         cdef map[string, arm_info] r
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))
 *         return {             # <<<<<<<<<<<<<<
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)
 *             for it in r
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    std::pair<std::string,jubatus::core::bandit::arm_info>  __pyx_7genexpr__pyx_v_it;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "src/bandit.pyx":40
 *         return {
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)
 *             for it in r             # <<<<<<<<<<<<<<
 *         }
 * 
 */
    __pyx_t_4 = __pyx_v_r.begin();
    for (;;) {
      if (!(__pyx_t_4 != __pyx_v_r.end())) break;
      __pyx_t_5 = *__pyx_t_4;
      ++__pyx_t_4;
      __pyx_7genexpr__pyx_v_it = __pyx_t_5;

      /* "src/bandit.pyx":39
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))
 *         return {
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)             # <<<<<<<<<<<<<<
 *             for it in r
 *         }
 */
      __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_7genexpr__pyx_v_it.first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ArmInfo); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_it.second.trial_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyFloat_FromDouble(__pyx_7genexpr__pyx_v_it.second.weight); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 39, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 39, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 39, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
        __pyx_t_8 = 0;
        __pyx_t_9 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 39, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 39, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "src/bandit.pyx":40
 *         return {
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)
 *             for it in r             # <<<<<<<<<<<<<<
 *         }
 * 
 */
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":35
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)
 * 
 *     def get_arm_info(self, player_id):             # <<<<<<<<<<<<<<
 *         cdef map[string, arm_info] r
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("embedded_jubatus._BanditWrapper.get_arm_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/bandit.pyx":43
 *         }
 * 
 *     def reset(self, player_id):             # <<<<<<<<<<<<<<
 *         return self._handle.reset(player_id.encode('utf8'))
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_17reset(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_BanditWrapper_17reset(PyObject *__pyx_v_self, PyObject *__pyx_v_player_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_BanditWrapper_16reset(((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_player_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_BanditWrapper_16reset(struct __pyx_obj_16embedded_jubatus__BanditWrapper *__pyx_v_self, PyObject *__pyx_v_player_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "src/bandit.pyx":44
 * 
 *     def reset(self, player_id):
 *         return self._handle.reset(player_id.encode('utf8'))             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_player_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->reset(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/bandit.pyx":43
 *         }
 * 
 *     def reset(self, player_id):             # <<<<<<<<<<<<<<
 *         return self._handle.reset(player_id.encode('utf8'))
 */

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

/* "src/burst.pyx":1
 * cdef _to_window(const pair[double, vector[_Burst.Batch]]& r):             # <<<<<<<<<<<<<<
 *     return Window(r.first, [
 *         Batch(r.second[i].all_data_count,
 */

static PyObject *__pyx_f_16embedded_jubatus__to_window(std::pair<double,std::vector<_Burst::Batch> >  const &__pyx_v_r) {
  size_t __pyx_v_i;
  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;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("_to_window", 0);

  /* "src/burst.pyx":2
 * cdef _to_window(const pair[double, vector[_Burst.Batch]]& r):
 *     return Window(r.first, [             # <<<<<<<<<<<<<<
 *         Batch(r.second[i].all_data_count,
 *               r.second[i].relevant_data_count,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Window); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_r.first); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "src/burst.pyx":6
 *               r.second[i].relevant_data_count,
 *               r.second[i].burst_weight)
 *         for i in range(r.second.size())             # <<<<<<<<<<<<<<
 *     ])
 * 
 */
  __pyx_t_5 = __pyx_v_r.second.size();
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "src/burst.pyx":3
 * cdef _to_window(const pair[double, vector[_Burst.Batch]]& r):
 *     return Window(r.first, [
 *         Batch(r.second[i].all_data_count,             # <<<<<<<<<<<<<<
 *               r.second[i].relevant_data_count,
 *               r.second[i].burst_weight)
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Batch); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyInt_From_int((__pyx_v_r.second[__pyx_v_i]).all_data_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "src/burst.pyx":4
 *     return Window(r.first, [
 *         Batch(r.second[i].all_data_count,
 *               r.second[i].relevant_data_count,             # <<<<<<<<<<<<<<
 *               r.second[i].burst_weight)
 *         for i in range(r.second.size())
 */
    __pyx_t_10 = __Pyx_PyInt_From_int((__pyx_v_r.second[__pyx_v_i]).relevant_data_count); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 4, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "src/burst.pyx":5
 *         Batch(r.second[i].all_data_count,
 *               r.second[i].relevant_data_count,
 *               r.second[i].burst_weight)             # <<<<<<<<<<<<<<
 *         for i in range(r.second.size())
 *     ])
 */
    __pyx_t_11 = PyFloat_FromDouble((__pyx_v_r.second[__pyx_v_i]).burst_weight); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_13 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_9, __pyx_t_10, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_9, __pyx_t_10, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    } else
    #endif
    {
      __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 3, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__pyx_t_12) {
        __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_11);
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      __pyx_t_11 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(5, 2, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_13 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_13 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_13, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":1
 * cdef _to_window(const pair[double, vector[_Burst.Batch]]& r):             # <<<<<<<<<<<<<<
 *     return Window(r.first, [
 *         Batch(r.second[i].all_data_count,
 */

  /* function 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("embedded_jubatus._to_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/burst.pyx":9
 *     ])
 * 
 * cdef _to_window_list(map[string, pair[double, vector[_Burst.Batch]]]& r):             # <<<<<<<<<<<<<<
 *     return {it.first.decode('utf8'): _to_window(it.second) for it in r}
 * 
 */

static PyObject *__pyx_f_16embedded_jubatus__to_window_list(std::map<std::string,std::pair<double,std::vector<_Burst::Batch> > >  &__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::map<std::string,std::pair<double,std::vector<_Burst::Batch> > > ::iterator __pyx_t_2;
  std::pair<std::string,std::pair<double,std::vector<_Burst::Batch> > >  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_to_window_list", 0);

  /* "src/burst.pyx":10
 * 
 * cdef _to_window_list(map[string, pair[double, vector[_Burst.Batch]]]& r):
 *     return {it.first.decode('utf8'): _to_window(it.second) for it in r}             # <<<<<<<<<<<<<<
 * 
 * cdef class _BurstWrapper:
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    std::pair<std::string,std::pair<double,std::vector<_Burst::Batch> > >  __pyx_8genexpr1__pyx_v_it;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_r.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_r.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_8genexpr1__pyx_v_it = __pyx_t_3;
      __pyx_t_4 = __Pyx_decode_cpp_string(__pyx_8genexpr1__pyx_v_it.first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 10, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_f_16embedded_jubatus__to_window(__pyx_8genexpr1__pyx_v_it.second); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 10, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 10, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":9
 *     ])
 * 
 * cdef _to_window_list(map[string, pair[double, vector[_Burst.Batch]]]& r):             # <<<<<<<<<<<<<<
 *     return {it.first.decode('utf8'): _to_window(it.second) for it in r}
 * 
 */

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

/* "src/burst.pyx":15
 *     cdef _Burst *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_13_BurstWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_13_BurstWrapper_1__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_16embedded_jubatus_13_BurstWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self));

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

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

  /* "src/burst.pyx":16
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/burst.pyx":15
 *     cdef _Burst *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/burst.pyx":18
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_13_BurstWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_13_BurstWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_13_BurstWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_13_BurstWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/burst.pyx":19
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/burst.pyx":20
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/burst.pyx":19
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/burst.pyx":18
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/burst.pyx":22
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/burst.pyx":26
 *         typ, ver = b'burst', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_lambda8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_lambda8 = {"lambda8", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_lambda8, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_lambda8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda8(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda8", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 26, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 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("embedded_jubatus._BurstWrapper._init.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/burst.pyx":27
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_1lambda9(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_1lambda9 = {"lambda9", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_1lambda9, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_1lambda9(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda9", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 27, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(5, 27, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 27, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 27, __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("embedded_jubatus._BurstWrapper._init.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/burst.pyx":28
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_2lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_2lambda10 = {"lambda10", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_2lambda10, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_2lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda10 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda10(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda10", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 28, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 28, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(5, 28, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 28, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* "src/burst.pyx":29
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_3lambda11(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_3lambda11 = {"lambda11", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_3lambda11, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init_3lambda11(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda11(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda11(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda11", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 29, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/burst.pyx":22
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_4_init(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Burst *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_2__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_2__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 22, __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);

  /* "src/burst.pyx":23
 * 
 *     def _init(self, config):
 *         self._handle = new _Burst(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'burst', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 23, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Burst(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(5, 23, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/burst.pyx":24
 *     def _init(self, config):
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_burst;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/burst.pyx":25
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/burst.pyx":26
 *         typ, ver = b'burst', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_lambda8, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/burst.pyx":27
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_1lambda9, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/burst.pyx":28
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_2lambda10, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/burst.pyx":29
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_BurstWrapper_5_init_3lambda11, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/burst.pyx":26
 *         typ, ver = b'burst', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":22
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Burst(config)
 *         typ, ver = b'burst', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._BurstWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/burst.pyx":33
 *         )
 * 
 *     def add_documents(self, data):             # <<<<<<<<<<<<<<
 *         ret = 0
 *         for doc in data:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_7add_documents(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_7add_documents(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_documents (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_6add_documents(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_6add_documents(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_doc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("add_documents", 0);

  /* "src/burst.pyx":34
 * 
 *     def add_documents(self, data):
 *         ret = 0             # <<<<<<<<<<<<<<
 *         for doc in data:
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_ret = __pyx_int_0;

  /* "src/burst.pyx":35
 *     def add_documents(self, data):
 *         ret = 0
 *         for doc in data:             # <<<<<<<<<<<<<<
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 *                 ret += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
    __pyx_t_1 = __pyx_v_data; __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_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 35, __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(5, 35, __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(5, 35, __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(5, 35, __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(5, 35, __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(5, 35, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(5, 35, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_doc, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "src/burst.pyx":36
 *         ret = 0
 *         for doc in data:
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):             # <<<<<<<<<<<<<<
 *                 ret += 1
 *         if ret > 0:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = (__pyx_v_self->_handle->add_document(__pyx_t_6, __pyx_t_7) != 0);
    if (__pyx_t_8) {

      /* "src/burst.pyx":37
 *         for doc in data:
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 *                 ret += 1             # <<<<<<<<<<<<<<
 *         if ret > 0:
 *             self._handle.calculate_results()
 */
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ret, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "src/burst.pyx":36
 *         ret = 0
 *         for doc in data:
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):             # <<<<<<<<<<<<<<
 *                 ret += 1
 *         if ret > 0:
 */
    }

    /* "src/burst.pyx":35
 *     def add_documents(self, data):
 *         ret = 0
 *         for doc in data:             # <<<<<<<<<<<<<<
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 *                 ret += 1
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/burst.pyx":38
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 *                 ret += 1
 *         if ret > 0:             # <<<<<<<<<<<<<<
 *             self._handle.calculate_results()
 *         return ret
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_ret, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 38, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "src/burst.pyx":39
 *                 ret += 1
 *         if ret > 0:
 *             self._handle.calculate_results()             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_v_self->_handle->calculate_results();

    /* "src/burst.pyx":38
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):
 *                 ret += 1
 *         if ret > 0:             # <<<<<<<<<<<<<<
 *             self._handle.calculate_results()
 *         return ret
 */
  }

  /* "src/burst.pyx":40
 *         if ret > 0:
 *             self._handle.calculate_results()
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def get_result(self, keyword):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/burst.pyx":33
 *         )
 * 
 *     def add_documents(self, data):             # <<<<<<<<<<<<<<
 *         ret = 0
 *         for doc in data:
 */

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

/* "src/burst.pyx":42
 *         return ret
 * 
 *     def get_result(self, keyword):             # <<<<<<<<<<<<<<
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_9get_result(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_9get_result(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_result (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_8get_result(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_keyword));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_8get_result(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("get_result", 0);

  /* "src/burst.pyx":43
 * 
 *     def get_result(self, keyword):
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))             # <<<<<<<<<<<<<<
 * 
 *     def get_result_at(self, keyword, pos):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_f_16embedded_jubatus__to_window(__pyx_v_self->_handle->get_result(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":42
 *         return ret
 * 
 *     def get_result(self, keyword):             # <<<<<<<<<<<<<<
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))
 * 
 */

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

/* "src/burst.pyx":45
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))
 * 
 *     def get_result_at(self, keyword, pos):             # <<<<<<<<<<<<<<
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_11get_result_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_11get_result_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_keyword = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_result_at (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_keyword,&__pyx_n_s_pos,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keyword)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_result_at", 1, 2, 2, 1); __PYX_ERR(5, 45, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_result_at") < 0)) __PYX_ERR(5, 45, __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_keyword = values[0];
    __pyx_v_pos = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_result_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 45, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._BurstWrapper.get_result_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_10get_result_at(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), __pyx_v_keyword, __pyx_v_pos);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_10get_result_at(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword, PyObject *__pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  double __pyx_t_4;
  __Pyx_RefNannySetupContext("get_result_at", 0);

  /* "src/burst.pyx":46
 * 
 *     def get_result_at(self, keyword, pos):
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))             # <<<<<<<<<<<<<<
 * 
 *     def get_all_bursted_results(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_pos); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 46, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_16embedded_jubatus__to_window(__pyx_v_self->_handle->get_result_at(__pyx_t_3, __pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":45
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))
 * 
 *     def get_result_at(self, keyword, pos):             # <<<<<<<<<<<<<<
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))
 * 
 */

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

/* "src/burst.pyx":48
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))
 * 
 *     def get_all_bursted_results(self):             # <<<<<<<<<<<<<<
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results()
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_13get_all_bursted_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_13get_all_bursted_results(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_bursted_results (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_12get_all_bursted_results(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_12get_all_bursted_results(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self) {
  std::map<std::string,std::pair<double,std::vector<_Burst::Batch> > >  __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_all_bursted_results", 0);

  /* "src/burst.pyx":50
 *     def get_all_bursted_results(self):
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results()             # <<<<<<<<<<<<<<
 *         return _to_window_list(r)
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->get_all_bursted_results();

  /* "src/burst.pyx":51
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results()
 *         return _to_window_list(r)             # <<<<<<<<<<<<<<
 * 
 *     def get_all_bursted_results_at(self, pos):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_16embedded_jubatus__to_window_list(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":48
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))
 * 
 *     def get_all_bursted_results(self):             # <<<<<<<<<<<<<<
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results()
 */

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

/* "src/burst.pyx":53
 *         return _to_window_list(r)
 * 
 *     def get_all_bursted_results_at(self, pos):             # <<<<<<<<<<<<<<
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results_at(pos)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_15get_all_bursted_results_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_15get_all_bursted_results_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_bursted_results_at (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_14get_all_bursted_results_at(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_pos));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_14get_all_bursted_results_at(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_pos) {
  std::map<std::string,std::pair<double,std::vector<_Burst::Batch> > >  __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_all_bursted_results_at", 0);

  /* "src/burst.pyx":55
 *     def get_all_bursted_results_at(self, pos):
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results_at(pos)             # <<<<<<<<<<<<<<
 *         return _to_window_list(r)
 * 
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_pos); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 55, __pyx_L1_error)
  __pyx_v_r = __pyx_v_self->_handle->get_all_bursted_results_at(__pyx_t_1);

  /* "src/burst.pyx":56
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results_at(pos)
 *         return _to_window_list(r)             # <<<<<<<<<<<<<<
 * 
 *     def get_all_keywords(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_16embedded_jubatus__to_window_list(__pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":53
 *         return _to_window_list(r)
 * 
 *     def get_all_bursted_results_at(self, pos):             # <<<<<<<<<<<<<<
 *         cdef map[string, pair[double, vector[_Burst.Batch]]] r
 *         r = self._handle.get_all_bursted_results_at(pos)
 */

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

/* "src/burst.pyx":58
 *         return _to_window_list(r)
 * 
 *     def get_all_keywords(self):             # <<<<<<<<<<<<<<
 *         cdef vector[keyword_with_params] r
 *         r = self._handle.get_all_keywords()
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_17get_all_keywords(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_17get_all_keywords(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_keywords (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_16get_all_keywords(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_16get_all_keywords(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self) {
  std::vector<jubatus::core::burst::keyword_with_params>  __pyx_v_r;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("get_all_keywords", 0);

  /* "src/burst.pyx":60
 *     def get_all_keywords(self):
 *         cdef vector[keyword_with_params] r
 *         r = self._handle.get_all_keywords()             # <<<<<<<<<<<<<<
 *         return [
 *             KeywordWithParams(r[i].keyword.decode('utf8'), r[i].scaling_param, r[i].gamma)
 */
  __pyx_v_r = __pyx_v_self->_handle->get_all_keywords();

  /* "src/burst.pyx":61
 *         cdef vector[keyword_with_params] r
 *         r = self._handle.get_all_keywords()
 *         return [             # <<<<<<<<<<<<<<
 *             KeywordWithParams(r[i].keyword.decode('utf8'), r[i].scaling_param, r[i].gamma)
 *             for i in range(r.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "src/burst.pyx":63
 *         return [
 *             KeywordWithParams(r[i].keyword.decode('utf8'), r[i].scaling_param, r[i].gamma)
 *             for i in range(r.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_2 = __pyx_v_r.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/burst.pyx":62
 *         r = self._handle.get_all_keywords()
 *         return [
 *             KeywordWithParams(r[i].keyword.decode('utf8'), r[i].scaling_param, r[i].gamma)             # <<<<<<<<<<<<<<
 *             for i in range(r.size())
 *         ]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_KeywordWithParams); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_decode_cpp_string((__pyx_v_r[__pyx_v_i]).keyword, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_i]).scaling_param); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_i]).gamma); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 62, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 62, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(5, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":58
 *         return _to_window_list(r)
 * 
 *     def get_all_keywords(self):             # <<<<<<<<<<<<<<
 *         cdef vector[keyword_with_params] r
 *         r = self._handle.get_all_keywords()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._BurstWrapper.get_all_keywords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/burst.pyx":66
 *         ]
 * 
 *     def add_keyword(self, keyword):             # <<<<<<<<<<<<<<
 *         cdef keyword_params kp
 *         kp.scaling_param = keyword.scaling_param
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_19add_keyword(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_19add_keyword(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_keyword (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_18add_keyword(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_keyword));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_18add_keyword(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword) {
  jubatus::core::burst::keyword_params __pyx_v_kp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("add_keyword", 0);

  /* "src/burst.pyx":68
 *     def add_keyword(self, keyword):
 *         cdef keyword_params kp
 *         kp.scaling_param = keyword.scaling_param             # <<<<<<<<<<<<<<
 *         kp.gamma = keyword.gamma
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_scaling_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_kp.scaling_param = __pyx_t_2;

  /* "src/burst.pyx":69
 *         cdef keyword_params kp
 *         kp.scaling_param = keyword.scaling_param
 *         kp.gamma = keyword.gamma             # <<<<<<<<<<<<<<
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_gamma); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_kp.gamma = __pyx_t_2;

  /* "src/burst.pyx":70
 *         kp.scaling_param = keyword.scaling_param
 *         kp.gamma = keyword.gamma
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)             # <<<<<<<<<<<<<<
 * 
 *     def remove_keyword(self, keyword):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_keyword); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->add_keyword(__pyx_t_4, __pyx_v_kp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":66
 *         ]
 * 
 *     def add_keyword(self, keyword):             # <<<<<<<<<<<<<<
 *         cdef keyword_params kp
 *         kp.scaling_param = keyword.scaling_param
 */

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

/* "src/burst.pyx":72
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)
 * 
 *     def remove_keyword(self, keyword):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_keyword(keyword.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_21remove_keyword(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_21remove_keyword(PyObject *__pyx_v_self, PyObject *__pyx_v_keyword) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_keyword (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_20remove_keyword(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_keyword));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_20remove_keyword(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self, PyObject *__pyx_v_keyword) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("remove_keyword", 0);

  /* "src/burst.pyx":73
 * 
 *     def remove_keyword(self, keyword):
 *         return self._handle.remove_keyword(keyword.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def remove_all_keywords(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keyword, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->remove_keyword(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":72
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)
 * 
 *     def remove_keyword(self, keyword):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_keyword(keyword.encode('utf8'))
 * 
 */

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

/* "src/burst.pyx":75
 *         return self._handle.remove_keyword(keyword.encode('utf8'))
 * 
 *     def remove_all_keywords(self):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_all_keywords()
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_23remove_all_keywords(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_BurstWrapper_23remove_all_keywords(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_all_keywords (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_BurstWrapper_22remove_all_keywords(((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_BurstWrapper_22remove_all_keywords(struct __pyx_obj_16embedded_jubatus__BurstWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("remove_all_keywords", 0);

  /* "src/burst.pyx":76
 * 
 *     def remove_all_keywords(self):
 *         return self._handle.remove_all_keywords()             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->remove_all_keywords()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/burst.pyx":75
 *         return self._handle.remove_keyword(keyword.encode('utf8'))
 * 
 *     def remove_all_keywords(self):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_all_keywords()
 */

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

/* "src/classifier.pyx":4
 *     cdef _Classifier *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_18_ClassifierWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_18_ClassifierWrapper_1__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_16embedded_jubatus_18_ClassifierWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self));

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

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

  /* "src/classifier.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/classifier.pyx":4
 *     cdef _Classifier *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/classifier.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_18_ClassifierWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_18_ClassifierWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/classifier.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/classifier.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/classifier.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/classifier.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/classifier.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/classifier.pyx":16
 *         typ, ver = b'classifier', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_lambda12(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_lambda12 = {"lambda12", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_lambda12, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_lambda12(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda12(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda12(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda12", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 16, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/classifier.pyx":17
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_1lambda13(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_1lambda13 = {"lambda13", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_1lambda13, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_1lambda13(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda13 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda13(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda13", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 17, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(2, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __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("embedded_jubatus._ClassifierWrapper._init.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":18
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_2lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_2lambda14 = {"lambda14", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_2lambda14, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_2lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda14 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda14(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda14", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 18, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 18, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(2, 18, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 18, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper._init.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":19
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_3lambda15(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_3lambda15 = {"lambda15", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_3lambda15, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init_3lambda15(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda15 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda15(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda15", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 19, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/classifier.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None
 */

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_4_init(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Classifier *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_3__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_3__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(2, 11, __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);

  /* "src/classifier.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Classifier(config)             # <<<<<<<<<<<<<<
 *         self.classes_ = None
 *         typ, ver = b'classifier', 1
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Classifier(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/classifier.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None             # <<<<<<<<<<<<<<
 *         typ, ver = b'classifier', 1
 *         return (
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_classes, Py_None) < 0) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "src/classifier.pyx":14
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None
 *         typ, ver = b'classifier', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_classifier;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/classifier.pyx":15
 *         self.classes_ = None
 *         typ, ver = b'classifier', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/classifier.pyx":16
 *         typ, ver = b'classifier', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_lambda12, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/classifier.pyx":17
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_1lambda13, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/classifier.pyx":18
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_2lambda14, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/classifier.pyx":19
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClassifierWrapper_5_init_3lambda15, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/classifier.pyx":16
 *         typ, ver = b'classifier', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/classifier.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Classifier(config)
 *         self.classes_ = None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":23
 *         )
 * 
 *     def train(self, data):             # <<<<<<<<<<<<<<
 *         cdef string l
 *         cdef datum d
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_7train(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_7train(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_6train(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_6train(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  std::string __pyx_v_l;
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_label = NULL;
  PyObject *__pyx_v_datum = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  __Pyx_RefNannySetupContext("train", 0);

  /* "src/classifier.pyx":26
 *         cdef string l
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             if len(data) == 0:
 *                 return 0
 */
  __pyx_t_1 = PyList_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/classifier.pyx":27
 *         cdef datum d
 *         if isinstance(data, list):
 *             if len(data) == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 27, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_3 == 0) != 0);
    if (__pyx_t_2) {

      /* "src/classifier.pyx":28
 *         if isinstance(data, list):
 *             if len(data) == 0:
 *                 return 0             # <<<<<<<<<<<<<<
 *             if isinstance(data[0], LabeledDatum):
 *                 for r in data:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_int_0);
      __pyx_r = __pyx_int_0;
      goto __pyx_L0;

      /* "src/classifier.pyx":27
 *         cdef datum d
 *         if isinstance(data, list):
 *             if len(data) == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):
 */
    }

    /* "src/classifier.pyx":29
 *             if len(data) == 0:
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):             # <<<<<<<<<<<<<<
 *                 for r in data:
 *                     label, datum = r.label, r.data
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LabeledDatum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_IsInstance(__pyx_t_4, __pyx_t_5); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 29, __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_t_2 != 0);
    if (__pyx_t_1) {

      /* "src/classifier.pyx":30
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):
 *                 for r in data:             # <<<<<<<<<<<<<<
 *                     label, datum = r.label, r.data
 *                     l = label.encode('utf8')
 */
      if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
        __pyx_t_5 = __pyx_v_data; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 30, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 30, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 30, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 30, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_6(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(2, 30, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "src/classifier.pyx":31
 *             if isinstance(data[0], LabeledDatum):
 *                 for r in data:
 *                     label, datum = r.label, r.data             # <<<<<<<<<<<<<<
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 31, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 31, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_datum, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "src/classifier.pyx":32
 *                 for r in data:
 *                     label, datum = r.label, r.data
 *                     l = label.encode('utf8')             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_l = __pyx_t_8;

        /* "src/classifier.pyx":33
 *                     label, datum = r.label, r.data
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)             # <<<<<<<<<<<<<<
 *                     self._handle.train(l, d)
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 */
        __pyx_t_4 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_datum, __pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "src/classifier.pyx":34
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)             # <<<<<<<<<<<<<<
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 *                 for label, datum in data:
 */
        __pyx_v_self->_handle->train(__pyx_v_l, __pyx_v_d);

        /* "src/classifier.pyx":30
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):
 *                 for r in data:             # <<<<<<<<<<<<<<
 *                     label, datum = r.label, r.data
 *                     l = label.encode('utf8')
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "src/classifier.pyx":29
 *             if len(data) == 0:
 *                 return 0
 *             if isinstance(data[0], LabeledDatum):             # <<<<<<<<<<<<<<
 *                 for r in data:
 *                     label, datum = r.label, r.data
 */
      goto __pyx_L5;
    }

    /* "src/classifier.pyx":35
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:             # <<<<<<<<<<<<<<
 *                 for label, datum in data:
 *                     l = label.encode('utf8')
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyTuple_Check(__pyx_t_5); 
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_10 = PyList_Check(__pyx_t_5); 
    __pyx_t_9 = (__pyx_t_10 != 0);
    __pyx_t_2 = __pyx_t_9;
    __pyx_L10_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = (__pyx_t_2 != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 35, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = ((__pyx_t_3 == 2) != 0);
    __pyx_t_1 = __pyx_t_9;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "src/classifier.pyx":36
 *                     self._handle.train(l, d)
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 *                 for label, datum in data:             # <<<<<<<<<<<<<<
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)
 */
      if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
        __pyx_t_5 = __pyx_v_data; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 36, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 36, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 36, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 36, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 36, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_6(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(2, 36, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
          PyObject* sequence = __pyx_t_4;
          #if !CYTHON_COMPILING_IN_PYPY
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(2, 36, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_11);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 36, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 36, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 36, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
          index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_11);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(2, 36, __pyx_L1_error)
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L15_unpacking_done;
          __pyx_L14_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(2, 36, __pyx_L1_error)
          __pyx_L15_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_datum, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "src/classifier.pyx":37
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 *                 for label, datum in data:
 *                     l = label.encode('utf8')             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 37, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 37, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 37, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_v_l = __pyx_t_8;

        /* "src/classifier.pyx":38
 *                 for label, datum in data:
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)             # <<<<<<<<<<<<<<
 *                     self._handle.train(l, d)
 *             else:
 */
        __pyx_t_11 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_datum, __pyx_v_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "src/classifier.pyx":39
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError
 */
        __pyx_v_self->_handle->train(__pyx_v_l, __pyx_v_d);

        /* "src/classifier.pyx":36
 *                     self._handle.train(l, d)
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 *                 for label, datum in data:             # <<<<<<<<<<<<<<
 *                     l = label.encode('utf8')
 *                     datum_py2native(datum, d)
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "src/classifier.pyx":35
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:             # <<<<<<<<<<<<<<
 *                 for label, datum in data:
 *                     l = label.encode('utf8')
 */
      goto __pyx_L5;
    }

    /* "src/classifier.pyx":41
 *                     self._handle.train(l, d)
 *             else:
 *                 raise ValueError             # <<<<<<<<<<<<<<
 *             return len(data)
 *         else:
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
      __PYX_ERR(2, 41, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "src/classifier.pyx":42
 *             else:
 *                 raise ValueError
 *             return len(data)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 42, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "src/classifier.pyx":26
 *         cdef string l
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             if len(data) == 0:
 *                 return 0
 */
  }

  /* "src/classifier.pyx":44
 *             return len(data)
 *         else:
 *             raise ValueError             # <<<<<<<<<<<<<<
 * 
 *     def classify(self, data):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(2, 44, __pyx_L1_error)
  }

  /* "src/classifier.pyx":23
 *         )
 * 
 *     def train(self, data):             # <<<<<<<<<<<<<<
 *         cdef string l
 *         cdef datum d
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XDECREF(__pyx_v_datum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":46
 *             raise ValueError
 * 
 *     def classify(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[classify_result_elem] r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_9classify(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_9classify(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("classify (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_8classify(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_8classify(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<jubatus::core::classifier::classify_result_elem>  __pyx_v_r;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_x = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("classify", 0);

  /* "src/classifier.pyx":49
 *         cdef datum d
 *         cdef vector[classify_result_elem] r
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             ret = []
 *             for x in data:
 */
  __pyx_t_1 = PyList_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/classifier.pyx":50
 *         cdef vector[classify_result_elem] r
 *         if isinstance(data, list):
 *             ret = []             # <<<<<<<<<<<<<<
 *             for x in data:
 *                 datum_py2native(x, d)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ret = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "src/classifier.pyx":51
 *         if isinstance(data, list):
 *             ret = []
 *             for x in data:             # <<<<<<<<<<<<<<
 *                 datum_py2native(x, d)
 *                 r = self._handle.classify(d)
 */
    if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
      __pyx_t_3 = __pyx_v_data; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 51, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 51, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 51, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 51, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 51, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(2, 51, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "src/classifier.pyx":52
 *             ret = []
 *             for x in data:
 *                 datum_py2native(x, d)             # <<<<<<<<<<<<<<
 *                 r = self._handle.classify(d)
 *                 ret.append([
 */
      __pyx_t_6 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_x, __pyx_v_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "src/classifier.pyx":53
 *             for x in data:
 *                 datum_py2native(x, d)
 *                 r = self._handle.classify(d)             # <<<<<<<<<<<<<<
 *                 ret.append([
 *                     EstimateResult(r[i].label.decode('utf8'), r[i].score)
 */
      __pyx_v_r = __pyx_v_self->_handle->classify(__pyx_v_d);

      /* "src/classifier.pyx":54
 *                 datum_py2native(x, d)
 *                 r = self._handle.classify(d)
 *                 ret.append([             # <<<<<<<<<<<<<<
 *                     EstimateResult(r[i].label.decode('utf8'), r[i].score)
 *                     for i in range(r.size())
 */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "src/classifier.pyx":56
 *                 ret.append([
 *                     EstimateResult(r[i].label.decode('utf8'), r[i].score)
 *                     for i in range(r.size())             # <<<<<<<<<<<<<<
 *                 ])
 *             return ret
 */
      __pyx_t_7 = __pyx_v_r.size();
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "src/classifier.pyx":55
 *                 r = self._handle.classify(d)
 *                 ret.append([
 *                     EstimateResult(r[i].label.decode('utf8'), r[i].score)             # <<<<<<<<<<<<<<
 *                     for i in range(r.size())
 *                 ])
 */
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_EstimateResult); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_decode_cpp_string((__pyx_v_r[__pyx_v_i]).label, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_i]).score); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
          __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 55, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
          __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 55, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 55, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_12);
          __pyx_t_11 = 0;
          __pyx_t_12 = 0;
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 55, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_9))) __PYX_ERR(2, 54, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "src/classifier.pyx":54
 *                 datum_py2native(x, d)
 *                 r = self._handle.classify(d)
 *                 ret.append([             # <<<<<<<<<<<<<<
 *                     EstimateResult(r[i].label.decode('utf8'), r[i].score)
 *                     for i in range(r.size())
 */
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(2, 54, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "src/classifier.pyx":51
 *         if isinstance(data, list):
 *             ret = []
 *             for x in data:             # <<<<<<<<<<<<<<
 *                 datum_py2native(x, d)
 *                 r = self._handle.classify(d)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "src/classifier.pyx":58
 *                     for i in range(r.size())
 *                 ])
 *             return ret             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_ret);
    __pyx_r = __pyx_v_ret;
    goto __pyx_L0;

    /* "src/classifier.pyx":49
 *         cdef datum d
 *         cdef vector[classify_result_elem] r
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             ret = []
 *             for x in data:
 */
  }

  /* "src/classifier.pyx":60
 *             return ret
 *         else:
 *             raise ValueError             # <<<<<<<<<<<<<<
 * 
 *     def get_labels(self):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(2, 60, __pyx_L1_error)
  }

  /* "src/classifier.pyx":46
 *             raise ValueError
 * 
 *     def classify(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[classify_result_elem] r
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.classify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":62
 *             raise ValueError
 * 
 *     def get_labels(self):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, uint64_t]] ret = self._handle.get_labels()
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_11get_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_11get_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_labels (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_10get_labels(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_10get_labels(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self) {
  std::vector<std::pair<std::string,uint64_t> >  __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_labels", 0);

  /* "src/classifier.pyx":63
 * 
 *     def get_labels(self):
 *         cdef vector[pair[string, uint64_t]] ret = self._handle.get_labels()             # <<<<<<<<<<<<<<
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}
 * 
 */
  __pyx_v_ret = __pyx_v_self->_handle->get_labels();

  /* "src/classifier.pyx":64
 *     def get_labels(self):
 *         cdef vector[pair[string, uint64_t]] ret = self._handle.get_labels()
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}             # <<<<<<<<<<<<<<
 * 
 *     def set_label(self, new_label):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    size_t __pyx_8genexpr2__pyx_v_i;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_ret.size();
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_8genexpr2__pyx_v_i = __pyx_t_3;
      __pyx_t_4 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_8genexpr2__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_ret[__pyx_8genexpr2__pyx_v_i]).second); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 64, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/classifier.pyx":62
 *             raise ValueError
 * 
 *     def get_labels(self):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, uint64_t]] ret = self._handle.get_labels()
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}
 */

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

/* "src/classifier.pyx":66
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}
 * 
 *     def set_label(self, new_label):             # <<<<<<<<<<<<<<
 *         return self._handle.set_label(new_label.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_13set_label(PyObject *__pyx_v_self, PyObject *__pyx_v_new_label); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_13set_label(PyObject *__pyx_v_self, PyObject *__pyx_v_new_label) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_label (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_12set_label(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_new_label));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_12set_label(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_new_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("set_label", 0);

  /* "src/classifier.pyx":67
 * 
 *     def set_label(self, new_label):
 *         return self._handle.set_label(new_label.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def delete_label(self, target_label):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->set_label(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/classifier.pyx":66
 *         return {ret[i].first.decode('utf8'): ret[i].second for i in range(ret.size())}
 * 
 *     def set_label(self, new_label):             # <<<<<<<<<<<<<<
 *         return self._handle.set_label(new_label.encode('utf8'))
 * 
 */

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

/* "src/classifier.pyx":69
 *         return self._handle.set_label(new_label.encode('utf8'))
 * 
 *     def delete_label(self, target_label):             # <<<<<<<<<<<<<<
 *         return self._handle.delete_label(target_label.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_15delete_label(PyObject *__pyx_v_self, PyObject *__pyx_v_target_label); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_15delete_label(PyObject *__pyx_v_self, PyObject *__pyx_v_target_label) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_label (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_14delete_label(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_target_label));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_14delete_label(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_target_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("delete_label", 0);

  /* "src/classifier.pyx":70
 * 
 *     def delete_label(self, target_label):
 *         return self._handle.delete_label(target_label.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def fit(self, X, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->delete_label(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/classifier.pyx":69
 *         return self._handle.set_label(new_label.encode('utf8'))
 * 
 *     def delete_label(self, target_label):             # <<<<<<<<<<<<<<
 *         return self._handle.delete_label(target_label.encode('utf8'))
 * 
 */

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

/* "src/classifier.pyx":72
 *         return self._handle.delete_label(target_label.encode('utf8'))
 * 
 *     def fit(self, X, y):             # <<<<<<<<<<<<<<
 *         self._handle.clear()
 *         self.classes_ = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_17fit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_17fit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_X = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fit", 1, 2, 2, 1); __PYX_ERR(2, 72, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit") < 0)) __PYX_ERR(2, 72, __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_X = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 72, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_16fit(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), __pyx_v_X, __pyx_v_y);

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_16fit(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("fit", 0);

  /* "src/classifier.pyx":73
 * 
 *     def fit(self, X, y):
 *         self._handle.clear()             # <<<<<<<<<<<<<<
 *         self.classes_ = None
 *         return self.partial_fit(X, y)
 */
  __pyx_v_self->_handle->clear();

  /* "src/classifier.pyx":74
 *     def fit(self, X, y):
 *         self._handle.clear()
 *         self.classes_ = None             # <<<<<<<<<<<<<<
 *         return self.partial_fit(X, y)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes, Py_None) < 0) __PYX_ERR(2, 74, __pyx_L1_error)

  /* "src/classifier.pyx":75
 *         self._handle.clear()
 *         self.classes_ = None
 *         return self.partial_fit(X, y)             # <<<<<<<<<<<<<<
 * 
 *     def partial_fit(self, X, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_partial_fit); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 75, __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_X, __pyx_v_y};
    __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(2, 75, __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_X, __pyx_v_y};
    __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(2, 75, __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(2, 75, __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_X);
    __Pyx_GIVEREF(__pyx_v_X);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_X);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_y);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/classifier.pyx":72
 *         return self._handle.delete_label(target_label.encode('utf8'))
 * 
 *     def fit(self, X, y):             # <<<<<<<<<<<<<<
 *         self._handle.clear()
 *         self.classes_ = None
 */

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

/* "src/classifier.pyx":77
 *         return self.partial_fit(X, y)
 * 
 *     def partial_fit(self, X, y):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_19partial_fit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_19partial_fit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_X = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partial_fit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("partial_fit", 1, 2, 2, 1); __PYX_ERR(2, 77, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partial_fit") < 0)) __PYX_ERR(2, 77, __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_X = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("partial_fit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 77, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.partial_fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_18partial_fit(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), __pyx_v_X, __pyx_v_y);

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_18partial_fit(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_np = NULL;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_max_label;
  PyObject *__pyx_v_rows = 0;
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::string>  __pyx_v_cache;
  int __pyx_v_is_ndarray;
  int __pyx_v_is_csr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  long __pyx_t_10;
  int __pyx_t_11;
  size_t __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("partial_fit", 0);

  /* "src/classifier.pyx":78
 * 
 *     def partial_fit(self, X, y):
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:
 *             raise ValueError('invalid shape')
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "src/classifier.pyx":79
 *     def partial_fit(self, X, y):
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid shape')
 *         cdef int i, j, max_label
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((__pyx_t_3 != 2) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((__pyx_t_3 != 1) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "src/classifier.pyx":80
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:
 *             raise ValueError('invalid shape')             # <<<<<<<<<<<<<<
 *         cdef int i, j, max_label
 *         cdef rows = X.shape[0]
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 80, __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, 80, __pyx_L1_error)

    /* "src/classifier.pyx":79
 *     def partial_fit(self, X, y):
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid shape')
 *         cdef int i, j, max_label
 */
  }

  /* "src/classifier.pyx":82
 *             raise ValueError('invalid shape')
 *         cdef int i, j, max_label
 *         cdef rows = X.shape[0]             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[string] cache
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rows = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "src/classifier.pyx":85
 *         cdef datum d
 *         cdef vector[string] cache
 *         cdef int is_ndarray = isinstance(X, np.ndarray)             # <<<<<<<<<<<<<<
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_6); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_is_ndarray = __pyx_t_2;

  /* "src/classifier.pyx":86
 *         cdef vector[string] cache
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')             # <<<<<<<<<<<<<<
 *         if not (is_ndarray or is_csr):
 *             raise ValueError
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_X)), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_n_s_csr_matrix, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_is_csr = __pyx_t_7;

  /* "src/classifier.pyx":87
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if self.classes_ is None:
 */
  __pyx_t_4 = (__pyx_v_is_ndarray != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_is_csr != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L8_bool_binop_done:;
  __pyx_t_4 = ((!__pyx_t_2) != 0);
  if (__pyx_t_4) {

    /* "src/classifier.pyx":88
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         if self.classes_ is None:
 *             self.classes_ = []
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(2, 88, __pyx_L1_error)

    /* "src/classifier.pyx":87
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if self.classes_ is None:
 */
  }

  /* "src/classifier.pyx":89
 *         if not (is_ndarray or is_csr):
 *             raise ValueError
 *         if self.classes_ is None:             # <<<<<<<<<<<<<<
 *             self.classes_ = []
 *         max_label = len(self.classes_) - 1
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 89, __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_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "src/classifier.pyx":90
 *             raise ValueError
 *         if self.classes_ is None:
 *             self.classes_ = []             # <<<<<<<<<<<<<<
 *         max_label = len(self.classes_) - 1
 *         for i in range(rows):
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes, __pyx_t_1) < 0) __PYX_ERR(2, 90, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "src/classifier.pyx":89
 *         if not (is_ndarray or is_csr):
 *             raise ValueError
 *         if self.classes_ is None:             # <<<<<<<<<<<<<<
 *             self.classes_ = []
 *         max_label = len(self.classes_) - 1
 */
  }

  /* "src/classifier.pyx":91
 *         if self.classes_ is None:
 *             self.classes_ = []
 *         max_label = len(self.classes_) - 1             # <<<<<<<<<<<<<<
 *         for i in range(rows):
 *             if is_ndarray:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_max_label = (__pyx_t_3 - 1);

  /* "src/classifier.pyx":92
 *             self.classes_ = []
 *         max_label = len(self.classes_) - 1
 *         for i in range(rows):             # <<<<<<<<<<<<<<
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)
 */
  __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_v_rows); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 92, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "src/classifier.pyx":93
 *         max_label = len(self.classes_) - 1
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
    __pyx_t_2 = (__pyx_v_is_ndarray != 0);
    if (__pyx_t_2) {

      /* "src/classifier.pyx":94
 *         for i in range(rows):
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)             # <<<<<<<<<<<<<<
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 */
      if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 94, __pyx_L1_error)
      __pyx_t_1 = __pyx_f_16embedded_jubatus_ndarray_to_datum(((PyArrayObject *)__pyx_v_X), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "src/classifier.pyx":93
 *         max_label = len(self.classes_) - 1
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
      goto __pyx_L13;
    }

    /* "src/classifier.pyx":96
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)             # <<<<<<<<<<<<<<
 *             for j in range(cache.size(), y[i] + 1):
 *                 cache.push_back(lexical_cast[string, int](j))
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 96, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 96, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 96, __pyx_L1_error)
      __pyx_t_9 = __pyx_f_16embedded_jubatus_csr_to_datum(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_6), ((PyArrayObject *)__pyx_t_5), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_L13:;

    /* "src/classifier.pyx":97
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             for j in range(cache.size(), y[i] + 1):             # <<<<<<<<<<<<<<
 *                 cache.push_back(lexical_cast[string, int](j))
 *             if max_label < y[i]:
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_5); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (__pyx_t_11 = __pyx_v_cache.size(); __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_j = __pyx_t_11;

      /* "src/classifier.pyx":98
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             for j in range(cache.size(), y[i] + 1):
 *                 cache.push_back(lexical_cast[string, int](j))             # <<<<<<<<<<<<<<
 *             if max_label < y[i]:
 *                 max_label = y[i]
 */
      try {
        __pyx_v_cache.push_back(jubatus::util::lang::lexical_cast<std::string,int>(__pyx_v_j));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(2, 98, __pyx_L1_error)
      }
    }

    /* "src/classifier.pyx":99
 *             for j in range(cache.size(), y[i] + 1):
 *                 cache.push_back(lexical_cast[string, int](j))
 *             if max_label < y[i]:             # <<<<<<<<<<<<<<
 *                 max_label = y[i]
 *             self._handle.train(cache[y[i]], d)
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_max_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {

      /* "src/classifier.pyx":100
 *                 cache.push_back(lexical_cast[string, int](j))
 *             if max_label < y[i]:
 *                 max_label = y[i]             # <<<<<<<<<<<<<<
 *             self._handle.train(cache[y[i]], d)
 *         for j in range(len(self.classes_), max_label + 1):
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_max_label = __pyx_t_11;

      /* "src/classifier.pyx":99
 *             for j in range(cache.size(), y[i] + 1):
 *                 cache.push_back(lexical_cast[string, int](j))
 *             if max_label < y[i]:             # <<<<<<<<<<<<<<
 *                 max_label = y[i]
 *             self._handle.train(cache[y[i]], d)
 */
    }

    /* "src/classifier.pyx":101
 *             if max_label < y[i]:
 *                 max_label = y[i]
 *             self._handle.train(cache[y[i]], d)             # <<<<<<<<<<<<<<
 *         for j in range(len(self.classes_), max_label + 1):
 *             self.classes_.append(j)
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_self->_handle->train((__pyx_v_cache[__pyx_t_12]), __pyx_v_d);
  }

  /* "src/classifier.pyx":102
 *                 max_label = y[i]
 *             self._handle.train(cache[y[i]], d)
 *         for j in range(len(self.classes_), max_label + 1):             # <<<<<<<<<<<<<<
 *             self.classes_.append(j)
 *         return self
 */
  __pyx_t_8 = (__pyx_v_max_label + 1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (__pyx_t_7 = __pyx_t_3; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_j = __pyx_t_7;

    /* "src/classifier.pyx":103
 *             self._handle.train(cache[y[i]], d)
 *         for j in range(len(self.classes_), max_label + 1):
 *             self.classes_.append(j)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_classes); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_9); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }

  /* "src/classifier.pyx":104
 *         for j in range(len(self.classes_), max_label + 1):
 *             self.classes_.append(j)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def decision_function(self, X):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "src/classifier.pyx":77
 *         return self.partial_fit(X, y)
 * 
 *     def partial_fit(self, X, y):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.partial_fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":106
 *         return self
 * 
 *     def decision_function(self, X):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_21decision_function(PyObject *__pyx_v_self, PyObject *__pyx_v_X); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_21decision_function(PyObject *__pyx_v_self, PyObject *__pyx_v_X) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decision_function (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_20decision_function(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_X));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_20decision_function(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X) {
  PyObject *__pyx_v_np = NULL;
  int __pyx_v_is_ndarray;
  int __pyx_v_is_csr;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  double __pyx_v_score;
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::string>  __pyx_v_cache;
  std::vector<jubatus::core::classifier::classify_result_elem>  __pyx_v_r;
  int __pyx_v_rows;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  float __pyx_t_11;
  size_t __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("decision_function", 0);

  /* "src/classifier.pyx":107
 * 
 *     def decision_function(self, X):
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "src/classifier.pyx":108
 *     def decision_function(self, X):
 *         import numpy as np
 *         if len(X.shape) != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((__pyx_t_2 != 2) != 0);
  if (__pyx_t_3) {

    /* "src/classifier.pyx":109
 *         import numpy as np
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')             # <<<<<<<<<<<<<<
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __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, 109, __pyx_L1_error)

    /* "src/classifier.pyx":108
 *     def decision_function(self, X):
 *         import numpy as np
 *         if len(X.shape) != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 */
  }

  /* "src/classifier.pyx":110
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)             # <<<<<<<<<<<<<<
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_is_ndarray = __pyx_t_3;

  /* "src/classifier.pyx":111
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')             # <<<<<<<<<<<<<<
 *         if not (is_ndarray or is_csr):
 *             raise ValueError
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_X)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_n_s_csr_matrix, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_is_csr = __pyx_t_5;

  /* "src/classifier.pyx":112
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef int i, j, k
 */
  __pyx_t_6 = (__pyx_v_is_ndarray != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_is_csr != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  __pyx_t_6 = ((!__pyx_t_3) != 0);
  if (__pyx_t_6) {

    /* "src/classifier.pyx":113
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef int i, j, k
 *         cdef double score
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(2, 113, __pyx_L1_error)

    /* "src/classifier.pyx":112
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef int i, j, k
 */
  }

  /* "src/classifier.pyx":119
 *         cdef vector[string] cache
 *         cdef vector[classify_result_elem] r
 *         cdef int rows = X.shape[0]             # <<<<<<<<<<<<<<
 *         ret = None
 *         for i in range(rows):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rows = __pyx_t_5;

  /* "src/classifier.pyx":120
 *         cdef vector[classify_result_elem] r
 *         cdef int rows = X.shape[0]
 *         ret = None             # <<<<<<<<<<<<<<
 *         for i in range(rows):
 *             if is_ndarray:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_ret = Py_None;

  /* "src/classifier.pyx":121
 *         cdef int rows = X.shape[0]
 *         ret = None
 *         for i in range(rows):             # <<<<<<<<<<<<<<
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)
 */
  __pyx_t_5 = __pyx_v_rows;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_5; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "src/classifier.pyx":122
 *         ret = None
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
    __pyx_t_6 = (__pyx_v_is_ndarray != 0);
    if (__pyx_t_6) {

      /* "src/classifier.pyx":123
 *         for i in range(rows):
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)             # <<<<<<<<<<<<<<
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 */
      if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 123, __pyx_L1_error)
      __pyx_t_1 = __pyx_f_16embedded_jubatus_ndarray_to_datum(((PyArrayObject *)__pyx_v_X), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "src/classifier.pyx":122
 *         ret = None
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
      goto __pyx_L9;
    }

    /* "src/classifier.pyx":125
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)             # <<<<<<<<<<<<<<
 *             r = self._handle.classify(d)
 *             if r.size() == 0:
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
      __pyx_t_9 = __pyx_f_16embedded_jubatus_csr_to_datum(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_4), ((PyArrayObject *)__pyx_t_8), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_L9:;

    /* "src/classifier.pyx":126
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)             # <<<<<<<<<<<<<<
 *             if r.size() == 0:
 *                 return np.zeros(rows)
 */
    __pyx_v_r = __pyx_v_self->_handle->classify(__pyx_v_d);

    /* "src/classifier.pyx":127
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)
 *             if r.size() == 0:             # <<<<<<<<<<<<<<
 *                 return np.zeros(rows)
 *             if r.size() == 2:
 */
    __pyx_t_6 = ((__pyx_v_r.size() == 0) != 0);
    if (__pyx_t_6) {

      /* "src/classifier.pyx":128
 *             r = self._handle.classify(d)
 *             if r.size() == 0:
 *                 return np.zeros(rows)             # <<<<<<<<<<<<<<
 *             if r.size() == 2:
 *                 if ret is None:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 128, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_9);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 128, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 128, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 128, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 128, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L0;

      /* "src/classifier.pyx":127
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)
 *             if r.size() == 0:             # <<<<<<<<<<<<<<
 *                 return np.zeros(rows)
 *             if r.size() == 2:
 */
    }

    /* "src/classifier.pyx":129
 *             if r.size() == 0:
 *                 return np.zeros(rows)
 *             if r.size() == 2:             # <<<<<<<<<<<<<<
 *                 if ret is None:
 *                     ret = np.zeros(rows)
 */
    __pyx_t_6 = ((__pyx_v_r.size() == 2) != 0);
    if (__pyx_t_6) {

      /* "src/classifier.pyx":130
 *                 return np.zeros(rows)
 *             if r.size() == 2:
 *                 if ret is None:             # <<<<<<<<<<<<<<
 *                     ret = np.zeros(rows)
 *                 if r[0].score < r[1].score:
 */
      __pyx_t_6 = (__pyx_v_ret == Py_None);
      __pyx_t_3 = (__pyx_t_6 != 0);
      if (__pyx_t_3) {

        /* "src/classifier.pyx":131
 *             if r.size() == 2:
 *                 if ret is None:
 *                     ret = np.zeros(rows)             # <<<<<<<<<<<<<<
 *                 if r[0].score < r[1].score:
 *                     j = lexical_cast[int, string](r[1].label)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 131, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_9);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_10};
            __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 131, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_10};
            __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 131, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 131, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_10);
            __pyx_t_10 = 0;
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 131, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "src/classifier.pyx":130
 *                 return np.zeros(rows)
 *             if r.size() == 2:
 *                 if ret is None:             # <<<<<<<<<<<<<<
 *                     ret = np.zeros(rows)
 *                 if r[0].score < r[1].score:
 */
      }

      /* "src/classifier.pyx":132
 *                 if ret is None:
 *                     ret = np.zeros(rows)
 *                 if r[0].score < r[1].score:             # <<<<<<<<<<<<<<
 *                     j = lexical_cast[int, string](r[1].label)
 *                     score = r[1].score
 */
      __pyx_t_3 = (((__pyx_v_r[0]).score < (__pyx_v_r[1]).score) != 0);
      if (__pyx_t_3) {

        /* "src/classifier.pyx":133
 *                     ret = np.zeros(rows)
 *                 if r[0].score < r[1].score:
 *                     j = lexical_cast[int, string](r[1].label)             # <<<<<<<<<<<<<<
 *                     score = r[1].score
 *                 else:
 */
        __pyx_v_j = jubatus::util::lang::lexical_cast<int,std::string>((__pyx_v_r[1]).label);

        /* "src/classifier.pyx":134
 *                 if r[0].score < r[1].score:
 *                     j = lexical_cast[int, string](r[1].label)
 *                     score = r[1].score             # <<<<<<<<<<<<<<
 *                 else:
 *                     j = lexical_cast[int, string](r[0].label)
 */
        __pyx_t_11 = (__pyx_v_r[1]).score;
        __pyx_v_score = __pyx_t_11;

        /* "src/classifier.pyx":132
 *                 if ret is None:
 *                     ret = np.zeros(rows)
 *                 if r[0].score < r[1].score:             # <<<<<<<<<<<<<<
 *                     j = lexical_cast[int, string](r[1].label)
 *                     score = r[1].score
 */
        goto __pyx_L13;
      }

      /* "src/classifier.pyx":136
 *                     score = r[1].score
 *                 else:
 *                     j = lexical_cast[int, string](r[0].label)             # <<<<<<<<<<<<<<
 *                     score = r[0].score
 *                 if j == 0:
 */
      /*else*/ {
        __pyx_v_j = jubatus::util::lang::lexical_cast<int,std::string>((__pyx_v_r[0]).label);

        /* "src/classifier.pyx":137
 *                 else:
 *                     j = lexical_cast[int, string](r[0].label)
 *                     score = r[0].score             # <<<<<<<<<<<<<<
 *                 if j == 0:
 *                     ret[i] = -score
 */
        __pyx_t_11 = (__pyx_v_r[0]).score;
        __pyx_v_score = __pyx_t_11;
      }
      __pyx_L13:;

      /* "src/classifier.pyx":138
 *                     j = lexical_cast[int, string](r[0].label)
 *                     score = r[0].score
 *                 if j == 0:             # <<<<<<<<<<<<<<
 *                     ret[i] = -score
 *                 else:
 */
      __pyx_t_3 = ((__pyx_v_j == 0) != 0);
      if (__pyx_t_3) {

        /* "src/classifier.pyx":139
 *                     score = r[0].score
 *                 if j == 0:
 *                     ret[i] = -score             # <<<<<<<<<<<<<<
 *                 else:
 *                     ret[i] = score
 */
        __pyx_t_9 = PyFloat_FromDouble((-__pyx_v_score)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 139, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(__Pyx_SetItemInt(__pyx_v_ret, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(2, 139, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "src/classifier.pyx":138
 *                     j = lexical_cast[int, string](r[0].label)
 *                     score = r[0].score
 *                 if j == 0:             # <<<<<<<<<<<<<<
 *                     ret[i] = -score
 *                 else:
 */
        goto __pyx_L14;
      }

      /* "src/classifier.pyx":141
 *                     ret[i] = -score
 *                 else:
 *                     ret[i] = score             # <<<<<<<<<<<<<<
 *             else:
 *                 if ret is None:
 */
      /*else*/ {
        __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 141, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(__Pyx_SetItemInt(__pyx_v_ret, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(2, 141, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L14:;

      /* "src/classifier.pyx":129
 *             if r.size() == 0:
 *                 return np.zeros(rows)
 *             if r.size() == 2:             # <<<<<<<<<<<<<<
 *                 if ret is None:
 *                     ret = np.zeros(rows)
 */
      goto __pyx_L11;
    }

    /* "src/classifier.pyx":143
 *                     ret[i] = score
 *             else:
 *                 if ret is None:             # <<<<<<<<<<<<<<
 *                     ret = np.zeros((rows, r.size()))
 *                 for j in range(r.size()):
 */
    /*else*/ {
      __pyx_t_3 = (__pyx_v_ret == Py_None);
      __pyx_t_6 = (__pyx_t_3 != 0);
      if (__pyx_t_6) {

        /* "src/classifier.pyx":144
 *             else:
 *                 if ret is None:
 *                     ret = np.zeros((rows, r.size()))             # <<<<<<<<<<<<<<
 *                 for j in range(r.size()):
 *                     k = lexical_cast[int, string](r[j].label)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 144, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 144, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_r.size()); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 144, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 144, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
        __pyx_t_1 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 144, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_9);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
            __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 144, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
            __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 144, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 144, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 144, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "src/classifier.pyx":143
 *                     ret[i] = score
 *             else:
 *                 if ret is None:             # <<<<<<<<<<<<<<
 *                     ret = np.zeros((rows, r.size()))
 *                 for j in range(r.size()):
 */
      }

      /* "src/classifier.pyx":145
 *                 if ret is None:
 *                     ret = np.zeros((rows, r.size()))
 *                 for j in range(r.size()):             # <<<<<<<<<<<<<<
 *                     k = lexical_cast[int, string](r[j].label)
 *                     ret[i,k] = r[j].score
 */
      __pyx_t_12 = __pyx_v_r.size();
      for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
        __pyx_v_j = __pyx_t_13;

        /* "src/classifier.pyx":146
 *                     ret = np.zeros((rows, r.size()))
 *                 for j in range(r.size()):
 *                     k = lexical_cast[int, string](r[j].label)             # <<<<<<<<<<<<<<
 *                     ret[i,k] = r[j].score
 *         return ret
 */
        __pyx_v_k = jubatus::util::lang::lexical_cast<int,std::string>((__pyx_v_r[__pyx_v_j]).label);

        /* "src/classifier.pyx":147
 *                 for j in range(r.size()):
 *                     k = lexical_cast[int, string](r[j].label)
 *                     ret[i,k] = r[j].score             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
        __pyx_t_9 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_j]).score); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
        __pyx_t_8 = 0;
        __pyx_t_1 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_t_4, __pyx_t_9) < 0)) __PYX_ERR(2, 147, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __pyx_L11:;
  }

  /* "src/classifier.pyx":148
 *                     k = lexical_cast[int, string](r[j].label)
 *                     ret[i,k] = r[j].score
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def predict(self, X):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/classifier.pyx":106
 *         return self
 * 
 *     def decision_function(self, X):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.decision_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/classifier.pyx":150
 *         return ret
 * 
 *     def predict(self, X):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_23predict(PyObject *__pyx_v_self, PyObject *__pyx_v_X); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_23predict(PyObject *__pyx_v_self, PyObject *__pyx_v_X) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("predict (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClassifierWrapper_22predict(((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_X));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClassifierWrapper_22predict(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *__pyx_v_self, PyObject *__pyx_v_X) {
  PyObject *__pyx_v_np = NULL;
  int __pyx_v_is_ndarray;
  int __pyx_v_is_csr;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_max_j;
  double __pyx_v_max_score;
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::string>  __pyx_v_cache;
  std::vector<jubatus::core::classifier::classify_result_elem>  __pyx_v_r;
  int __pyx_v_rows;
  PyArrayObject *__pyx_v_ret = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ret;
  __Pyx_Buffer __pyx_pybuffer_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  float __pyx_t_12;
  size_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __Pyx_RefNannySetupContext("predict", 0);
  __pyx_pybuffer_ret.pybuffer.buf = NULL;
  __pyx_pybuffer_ret.refcount = 0;
  __pyx_pybuffernd_ret.data = NULL;
  __pyx_pybuffernd_ret.rcbuffer = &__pyx_pybuffer_ret;

  /* "src/classifier.pyx":151
 * 
 *     def predict(self, X):
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "src/classifier.pyx":152
 *     def predict(self, X):
 *         import numpy as np
 *         if len(X.shape) != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((__pyx_t_2 != 2) != 0);
  if (__pyx_t_3) {

    /* "src/classifier.pyx":153
 *         import numpy as np
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')             # <<<<<<<<<<<<<<
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 153, __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, 153, __pyx_L1_error)

    /* "src/classifier.pyx":152
 *     def predict(self, X):
 *         import numpy as np
 *         if len(X.shape) != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 */
  }

  /* "src/classifier.pyx":154
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)             # <<<<<<<<<<<<<<
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_is_ndarray = __pyx_t_3;

  /* "src/classifier.pyx":155
 *             raise ValueError('invalid X.shape')
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')             # <<<<<<<<<<<<<<
 *         if not (is_ndarray or is_csr):
 *             raise ValueError
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_X)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_n_s_csr_matrix, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_is_csr = __pyx_t_5;

  /* "src/classifier.pyx":156
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef int i, j, max_j
 */
  __pyx_t_6 = (__pyx_v_is_ndarray != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_is_csr != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  __pyx_t_6 = ((!__pyx_t_3) != 0);
  if (__pyx_t_6) {

    /* "src/classifier.pyx":157
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef int i, j, max_j
 *         cdef double max_score
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(2, 157, __pyx_L1_error)

    /* "src/classifier.pyx":156
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 *         if not (is_ndarray or is_csr):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef int i, j, max_j
 */
  }

  /* "src/classifier.pyx":163
 *         cdef vector[string] cache
 *         cdef vector[classify_result_elem] r
 *         cdef int rows = X.shape[0]             # <<<<<<<<<<<<<<
 *         IF NUMPY:
 *             cdef c_np.ndarray[c_np.int32_t, ndim=1] ret = np.zeros(rows, dtype=np.int32)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rows = __pyx_t_5;

  /* "src/classifier.pyx":165
 *         cdef int rows = X.shape[0]
 *         IF NUMPY:
 *             cdef c_np.ndarray[c_np.int32_t, ndim=1] ret = np.zeros(rows, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         ELSE:
 *             ret = np.zeros(rows, dtype=np.int32)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 165, __pyx_L1_error)
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ret.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ret = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ret.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(2, 165, __pyx_L1_error)
    } else {__pyx_pybuffernd_ret.diminfo[0].strides = __pyx_pybuffernd_ret.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ret.diminfo[0].shape = __pyx_pybuffernd_ret.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_9 = 0;
  __pyx_v_ret = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "src/classifier.pyx":168
 *         ELSE:
 *             ret = np.zeros(rows, dtype=np.int32)
 *         for i in range(rows):             # <<<<<<<<<<<<<<
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)
 */
  __pyx_t_5 = __pyx_v_rows;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_5; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "src/classifier.pyx":169
 *             ret = np.zeros(rows, dtype=np.int32)
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
    __pyx_t_6 = (__pyx_v_is_ndarray != 0);
    if (__pyx_t_6) {

      /* "src/classifier.pyx":170
 *         for i in range(rows):
 *             if is_ndarray:
 *                 ndarray_to_datum(X, i, d, cache)             # <<<<<<<<<<<<<<
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 */
      if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 170, __pyx_L1_error)
      __pyx_t_8 = __pyx_f_16embedded_jubatus_ndarray_to_datum(((PyArrayObject *)__pyx_v_X), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "src/classifier.pyx":169
 *             ret = np.zeros(rows, dtype=np.int32)
 *         for i in range(rows):
 *             if is_ndarray:             # <<<<<<<<<<<<<<
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 */
      goto __pyx_L9;
    }

    /* "src/classifier.pyx":172
 *                 ndarray_to_datum(X, i, d, cache)
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)             # <<<<<<<<<<<<<<
 *             r = self._handle.classify(d)
 *             if r.size() == 0:
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 172, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 172, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 172, __pyx_L1_error)
      __pyx_t_1 = __pyx_f_16embedded_jubatus_csr_to_datum(((PyArrayObject *)__pyx_t_8), ((PyArrayObject *)__pyx_t_4), ((PyArrayObject *)__pyx_t_7), __pyx_v_i, __pyx_v_d, __pyx_v_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L9:;

    /* "src/classifier.pyx":173
 *             else:
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)             # <<<<<<<<<<<<<<
 *             if r.size() == 0:
 *                 break
 */
    __pyx_v_r = __pyx_v_self->_handle->classify(__pyx_v_d);

    /* "src/classifier.pyx":174
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)
 *             if r.size() == 0:             # <<<<<<<<<<<<<<
 *                 break
 *             max_j, max_score = 0, r[0].score
 */
    __pyx_t_6 = ((__pyx_v_r.size() == 0) != 0);
    if (__pyx_t_6) {

      /* "src/classifier.pyx":175
 *             r = self._handle.classify(d)
 *             if r.size() == 0:
 *                 break             # <<<<<<<<<<<<<<
 *             max_j, max_score = 0, r[0].score
 *             for j in range(1, r.size()):
 */
      goto __pyx_L8_break;

      /* "src/classifier.pyx":174
 *                 csr_to_datum(X.data, X.indices, X.indptr, i, d, cache)
 *             r = self._handle.classify(d)
 *             if r.size() == 0:             # <<<<<<<<<<<<<<
 *                 break
 *             max_j, max_score = 0, r[0].score
 */
    }

    /* "src/classifier.pyx":176
 *             if r.size() == 0:
 *                 break
 *             max_j, max_score = 0, r[0].score             # <<<<<<<<<<<<<<
 *             for j in range(1, r.size()):
 *                 if r[j].score > max_score:
 */
    __pyx_t_11 = 0;
    __pyx_t_12 = (__pyx_v_r[0]).score;
    __pyx_v_max_j = __pyx_t_11;
    __pyx_v_max_score = __pyx_t_12;

    /* "src/classifier.pyx":177
 *                 break
 *             max_j, max_score = 0, r[0].score
 *             for j in range(1, r.size()):             # <<<<<<<<<<<<<<
 *                 if r[j].score > max_score:
 *                     max_j, max_score = j, r[j].score
 */
    __pyx_t_13 = __pyx_v_r.size();
    for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
      __pyx_v_j = __pyx_t_11;

      /* "src/classifier.pyx":178
 *             max_j, max_score = 0, r[0].score
 *             for j in range(1, r.size()):
 *                 if r[j].score > max_score:             # <<<<<<<<<<<<<<
 *                     max_j, max_score = j, r[j].score
 *             ret[i] = lexical_cast[int, string](r[max_j].label)
 */
      __pyx_t_6 = (((__pyx_v_r[__pyx_v_j]).score > __pyx_v_max_score) != 0);
      if (__pyx_t_6) {

        /* "src/classifier.pyx":179
 *             for j in range(1, r.size()):
 *                 if r[j].score > max_score:
 *                     max_j, max_score = j, r[j].score             # <<<<<<<<<<<<<<
 *             ret[i] = lexical_cast[int, string](r[max_j].label)
 *         return ret
 */
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_12 = (__pyx_v_r[__pyx_v_j]).score;
        __pyx_v_max_j = __pyx_t_14;
        __pyx_v_max_score = __pyx_t_12;

        /* "src/classifier.pyx":178
 *             max_j, max_score = 0, r[0].score
 *             for j in range(1, r.size()):
 *                 if r[j].score > max_score:             # <<<<<<<<<<<<<<
 *                     max_j, max_score = j, r[j].score
 *             ret[i] = lexical_cast[int, string](r[max_j].label)
 */
      }
    }

    /* "src/classifier.pyx":180
 *                 if r[j].score > max_score:
 *                     max_j, max_score = j, r[j].score
 *             ret[i] = lexical_cast[int, string](r[max_j].label)             # <<<<<<<<<<<<<<
 *         return ret
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_11 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_ret.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_ret.diminfo[0].shape)) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      __PYX_ERR(2, 180, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ret.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_ret.diminfo[0].strides) = jubatus::util::lang::lexical_cast<int,std::string>((__pyx_v_r[__pyx_v_max_j]).label);
  }
  __pyx_L8_break:;

  /* "src/classifier.pyx":181
 *                     max_j, max_score = j, r[j].score
 *             ret[i] = lexical_cast[int, string](r[max_j].label)
 *         return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  /* "src/classifier.pyx":150
 *         return ret
 * 
 *     def predict(self, X):             # <<<<<<<<<<<<<<
 *         import numpy as np
 *         if len(X.shape) != 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ret.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("embedded_jubatus._ClassifierWrapper.predict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ret.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF((PyObject *)__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":4
 *     cdef _Clustering *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_18_ClusteringWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_18_ClusteringWrapper_1__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_16embedded_jubatus_18_ClusteringWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

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

  /* "src/clustering.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/clustering.pyx":4
 *     cdef _Clustering *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/clustering.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_18_ClusteringWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_18_ClusteringWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/clustering.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/clustering.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/clustering.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/clustering.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/clustering.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/clustering.pyx":15
 *         typ, ver = b'clustering', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_lambda16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_lambda16 = {"lambda16", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_lambda16, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_lambda16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda16 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda16(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda16", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/clustering.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_1lambda17(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_1lambda17 = {"lambda17", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_1lambda17, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_1lambda17(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda17 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda17(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda17(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda17", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(6, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 16, __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("embedded_jubatus._ClusteringWrapper._init.lambda17", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_2lambda18(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_2lambda18 = {"lambda18", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_2lambda18, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_2lambda18(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda18 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda18(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda18(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda18", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(6, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper._init.lambda18", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_3lambda19(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_3lambda19 = {"lambda19", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_3lambda19, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init_3lambda19(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda19 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda19(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda19", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/clustering.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_4_init(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Clustering *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_4__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_4__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 11, __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);

  /* "src/clustering.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Clustering(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'clustering', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Clustering(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(6, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/clustering.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_clustering;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/clustering.pyx":14
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/clustering.pyx":15
 *         typ, ver = b'clustering', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_lambda16, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/clustering.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_1lambda17, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/clustering.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_2lambda18, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/clustering.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_ClusteringWrapper_5_init_3lambda19, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/clustering.pyx":15
 *         typ, ver = b'clustering', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/clustering.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Clustering(config)
 *         typ, ver = b'clustering', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":22
 *         )
 * 
 *     def push(self, points):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[indexed_point] v
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_7push(PyObject *__pyx_v_self, PyObject *__pyx_v_points); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_7push(PyObject *__pyx_v_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("push (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_6push(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_6push(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_points) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<jubatus::core::clustering::indexed_point>  __pyx_v_v;
  jubatus::core::clustering::indexed_point __pyx_v_ip;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("push", 0);

  /* "src/clustering.pyx":26
 *         cdef vector[indexed_point] v
 *         cdef indexed_point ip
 *         for p in points:             # <<<<<<<<<<<<<<
 *             datum_py2native(p.point, d)
 *             ip.id = p.id.encode('utf8')
 */
  if (likely(PyList_CheckExact(__pyx_v_points)) || PyTuple_CheckExact(__pyx_v_points)) {
    __pyx_t_1 = __pyx_v_points; __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_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __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(6, 26, __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(6, 26, __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(6, 26, __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(6, 26, __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(6, 26, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 26, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "src/clustering.pyx":27
 *         cdef indexed_point ip
 *         for p in points:
 *             datum_py2native(p.point, d)             # <<<<<<<<<<<<<<
 *             ip.id = p.id.encode('utf8')
 *             ip.point = d
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_t_4, __pyx_v_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "src/clustering.pyx":28
 *         for p in points:
 *             datum_py2native(p.point, d)
 *             ip.id = p.id.encode('utf8')             # <<<<<<<<<<<<<<
 *             ip.point = d
 *             v.push_back(ip)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_id_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 28, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_ip.id = __pyx_t_6;

    /* "src/clustering.pyx":29
 *             datum_py2native(p.point, d)
 *             ip.id = p.id.encode('utf8')
 *             ip.point = d             # <<<<<<<<<<<<<<
 *             v.push_back(ip)
 *         self._handle.push(v)
 */
    __pyx_v_ip.point = __pyx_v_d;

    /* "src/clustering.pyx":30
 *             ip.id = p.id.encode('utf8')
 *             ip.point = d
 *             v.push_back(ip)             # <<<<<<<<<<<<<<
 *         self._handle.push(v)
 *         return True
 */
    try {
      __pyx_v_v.push_back(__pyx_v_ip);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 30, __pyx_L1_error)
    }

    /* "src/clustering.pyx":26
 *         cdef vector[indexed_point] v
 *         cdef indexed_point ip
 *         for p in points:             # <<<<<<<<<<<<<<
 *             datum_py2native(p.point, d)
 *             ip.id = p.id.encode('utf8')
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/clustering.pyx":31
 *             ip.point = d
 *             v.push_back(ip)
 *         self._handle.push(v)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->push(__pyx_v_v);

  /* "src/clustering.pyx":32
 *             v.push_back(ip)
 *         self._handle.push(v)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def get_revision(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/clustering.pyx":22
 *         )
 * 
 *     def push(self, points):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[indexed_point] v
 */

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

/* "src/clustering.pyx":34
 *         return True
 * 
 *     def get_revision(self):             # <<<<<<<<<<<<<<
 *         return self._handle.get_revision()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_9get_revision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_9get_revision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_revision (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_8get_revision(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_8get_revision(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_revision", 0);

  /* "src/clustering.pyx":35
 * 
 *     def get_revision(self):
 *         return self._handle.get_revision()             # <<<<<<<<<<<<<<
 * 
 *     def get_core_members(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_handle->get_revision()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/clustering.pyx":34
 *         return True
 * 
 *     def get_revision(self):             # <<<<<<<<<<<<<<
 *         return self._handle.get_revision()
 * 
 */

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

/* "src/clustering.pyx":37
 *         return self._handle.get_revision()
 * 
 *     def get_core_members(self):             # <<<<<<<<<<<<<<
 *         cdef vector[vector[pair[double, datum]]] r
 *         r = self._handle.get_core_members()
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_11get_core_members(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_11get_core_members(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_core_members (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_10get_core_members(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_10get_core_members(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self) {
  std::vector<std::vector<std::pair<double,jubatus::core::fv_converter::datum> > >  __pyx_v_r;
  PyObject *__pyx_v_ret = NULL;
  size_t __pyx_v_i;
  size_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("get_core_members", 0);

  /* "src/clustering.pyx":39
 *     def get_core_members(self):
 *         cdef vector[vector[pair[double, datum]]] r
 *         r = self._handle.get_core_members()             # <<<<<<<<<<<<<<
 *         ret = []
 *         for i in range(r.size()):
 */
  __pyx_v_r = __pyx_v_self->_handle->get_core_members();

  /* "src/clustering.pyx":40
 *         cdef vector[vector[pair[double, datum]]] r
 *         r = self._handle.get_core_members()
 *         ret = []             # <<<<<<<<<<<<<<
 *         for i in range(r.size()):
 *             ret.append([
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/clustering.pyx":41
 *         r = self._handle.get_core_members()
 *         ret = []
 *         for i in range(r.size()):             # <<<<<<<<<<<<<<
 *             ret.append([
 *                 WeightedDatum(r[i][j].first, datum_native2py(r[i][j].second))
 */
  __pyx_t_2 = __pyx_v_r.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/clustering.pyx":42
 *         ret = []
 *         for i in range(r.size()):
 *             ret.append([             # <<<<<<<<<<<<<<
 *                 WeightedDatum(r[i][j].first, datum_native2py(r[i][j].second))
 *                 for j in range(r[i].size())
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "src/clustering.pyx":44
 *             ret.append([
 *                 WeightedDatum(r[i][j].first, datum_native2py(r[i][j].second))
 *                 for j in range(r[i].size())             # <<<<<<<<<<<<<<
 *             ])
 *         return ret
 */
    __pyx_t_4 = (__pyx_v_r[__pyx_v_i]).size();
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_j = __pyx_t_5;

      /* "src/clustering.pyx":43
 *         for i in range(r.size()):
 *             ret.append([
 *                 WeightedDatum(r[i][j].first, datum_native2py(r[i][j].second))             # <<<<<<<<<<<<<<
 *                 for j in range(r[i].size())
 *             ])
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_WeightedDatum); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyFloat_FromDouble(((__pyx_v_r[__pyx_v_i])[__pyx_v_j]).first); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __pyx_f_16embedded_jubatus_datum_native2py(((__pyx_v_r[__pyx_v_i])[__pyx_v_j]).second); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
        __pyx_t_8 = 0;
        __pyx_t_9 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 43, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 42, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }

    /* "src/clustering.pyx":42
 *         ret = []
 *         for i in range(r.size()):
 *             ret.append([             # <<<<<<<<<<<<<<
 *                 WeightedDatum(r[i][j].first, datum_native2py(r[i][j].second))
 *                 for j in range(r[i].size())
 */
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(6, 42, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "src/clustering.pyx":46
 *                 for j in range(r[i].size())
 *             ])
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def get_k_center(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/clustering.pyx":37
 *         return self._handle.get_revision()
 * 
 *     def get_core_members(self):             # <<<<<<<<<<<<<<
 *         cdef vector[vector[pair[double, datum]]] r
 *         r = self._handle.get_core_members()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper.get_core_members", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":48
 *         return ret
 * 
 *     def get_k_center(self):             # <<<<<<<<<<<<<<
 *         cdef vector[datum] r = self._handle.get_k_center()
 *         return [datum_native2py(r[i]) for i in range(r.size())]
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_13get_k_center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_13get_k_center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_k_center (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_12get_k_center(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_12get_k_center(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self) {
  std::vector<jubatus::core::fv_converter::datum>  __pyx_v_r;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_k_center", 0);

  /* "src/clustering.pyx":49
 * 
 *     def get_k_center(self):
 *         cdef vector[datum] r = self._handle.get_k_center()             # <<<<<<<<<<<<<<
 *         return [datum_native2py(r[i]) for i in range(r.size())]
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->get_k_center();

  /* "src/clustering.pyx":50
 *     def get_k_center(self):
 *         cdef vector[datum] r = self._handle.get_k_center()
 *         return [datum_native2py(r[i]) for i in range(r.size())]             # <<<<<<<<<<<<<<
 * 
 *     def get_nearest_center(self, point):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_r.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __pyx_f_16embedded_jubatus_datum_native2py((__pyx_v_r[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/clustering.pyx":48
 *         return ret
 * 
 *     def get_k_center(self):             # <<<<<<<<<<<<<<
 *         cdef vector[datum] r = self._handle.get_k_center()
 *         return [datum_native2py(r[i]) for i in range(r.size())]
 */

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

/* "src/clustering.pyx":52
 *         return [datum_native2py(r[i]) for i in range(r.size())]
 * 
 *     def get_nearest_center(self, point):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef datum r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_15get_nearest_center(PyObject *__pyx_v_self, PyObject *__pyx_v_point); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_15get_nearest_center(PyObject *__pyx_v_self, PyObject *__pyx_v_point) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nearest_center (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_14get_nearest_center(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_point));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_14get_nearest_center(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  jubatus::core::fv_converter::datum __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_nearest_center", 0);

  /* "src/clustering.pyx":55
 *         cdef datum d
 *         cdef datum r
 *         datum_py2native(point, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.get_nearest_center(d)
 *         return datum_native2py(r)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_point, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/clustering.pyx":56
 *         cdef datum r
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_center(d)             # <<<<<<<<<<<<<<
 *         return datum_native2py(r)
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->get_nearest_center(__pyx_v_d);

  /* "src/clustering.pyx":57
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_center(d)
 *         return datum_native2py(r)             # <<<<<<<<<<<<<<
 * 
 *     def get_nearest_members(self, point):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_native2py(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/clustering.pyx":52
 *         return [datum_native2py(r[i]) for i in range(r.size())]
 * 
 *     def get_nearest_center(self, point):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef datum r
 */

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

/* "src/clustering.pyx":59
 *         return datum_native2py(r)
 * 
 *     def get_nearest_members(self, point):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[double, datum]] r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_17get_nearest_members(PyObject *__pyx_v_self, PyObject *__pyx_v_point); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_17get_nearest_members(PyObject *__pyx_v_self, PyObject *__pyx_v_point) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nearest_members (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_16get_nearest_members(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_point));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_16get_nearest_members(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::pair<double,jubatus::core::fv_converter::datum> >  __pyx_v_r;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("get_nearest_members", 0);

  /* "src/clustering.pyx":62
 *         cdef datum d
 *         cdef vector[pair[double, datum]] r
 *         datum_py2native(point, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.get_nearest_members(d)
 *         return [
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_point, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/clustering.pyx":63
 *         cdef vector[pair[double, datum]] r
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_members(d)             # <<<<<<<<<<<<<<
 *         return [
 *             WeightedDatum(r[i].first, datum_native2py(r[i].second))
 */
  __pyx_v_r = __pyx_v_self->_handle->get_nearest_members(__pyx_v_d);

  /* "src/clustering.pyx":64
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_members(d)
 *         return [             # <<<<<<<<<<<<<<
 *             WeightedDatum(r[i].first, datum_native2py(r[i].second))
 *             for i in range(r.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "src/clustering.pyx":66
 *         return [
 *             WeightedDatum(r[i].first, datum_native2py(r[i].second))
 *             for i in range(r.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_2 = __pyx_v_r.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/clustering.pyx":65
 *         r = self._handle.get_nearest_members(d)
 *         return [
 *             WeightedDatum(r[i].first, datum_native2py(r[i].second))             # <<<<<<<<<<<<<<
 *             for i in range(r.size())
 *         ]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_WeightedDatum); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_i]).first); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_f_16embedded_jubatus_datum_native2py((__pyx_v_r[__pyx_v_i]).second); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 65, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 65, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/clustering.pyx":59
 *         return datum_native2py(r)
 * 
 *     def get_nearest_members(self, point):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[double, datum]] r
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper.get_nearest_members", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":69
 *         ]
 * 
 *     def get_core_members_light(self):             # <<<<<<<<<<<<<<
 *         cdef vector[vector[pair[double, string]]] r
 *         r = self._handle.get_core_members_light()
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_19get_core_members_light(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_19get_core_members_light(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_core_members_light (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_18get_core_members_light(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_18get_core_members_light(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self) {
  std::vector<std::vector<std::pair<double,std::string> > >  __pyx_v_r;
  PyObject *__pyx_v_ret = NULL;
  std::vector<std::pair<double,std::string> >  __pyx_v_c;
  PyObject *__pyx_v_tmp = NULL;
  std::pair<double,std::string>  __pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::vector<std::pair<double,std::string> > > ::iterator __pyx_t_2;
  std::vector<std::pair<double,std::string> >  __pyx_t_3;
  std::vector<std::pair<double,std::string> > ::iterator __pyx_t_4;
  std::pair<double,std::string>  __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("get_core_members_light", 0);

  /* "src/clustering.pyx":71
 *     def get_core_members_light(self):
 *         cdef vector[vector[pair[double, string]]] r
 *         r = self._handle.get_core_members_light()             # <<<<<<<<<<<<<<
 *         ret = []
 *         for c in r:
 */
  __pyx_v_r = __pyx_v_self->_handle->get_core_members_light();

  /* "src/clustering.pyx":72
 *         cdef vector[vector[pair[double, string]]] r
 *         r = self._handle.get_core_members_light()
 *         ret = []             # <<<<<<<<<<<<<<
 *         for c in r:
 *             tmp = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/clustering.pyx":73
 *         r = self._handle.get_core_members_light()
 *         ret = []
 *         for c in r:             # <<<<<<<<<<<<<<
 *             tmp = []
 *             for m in c:
 */
  __pyx_t_2 = __pyx_v_r.begin();
  for (;;) {
    if (!(__pyx_t_2 != __pyx_v_r.end())) break;
    __pyx_t_3 = *__pyx_t_2;
    ++__pyx_t_2;
    __pyx_v_c = __pyx_t_3;

    /* "src/clustering.pyx":74
 *         ret = []
 *         for c in r:
 *             tmp = []             # <<<<<<<<<<<<<<
 *             for m in c:
 *                 tmp.append(WeightedIndex(m.first, m.second))
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "src/clustering.pyx":75
 *         for c in r:
 *             tmp = []
 *             for m in c:             # <<<<<<<<<<<<<<
 *                 tmp.append(WeightedIndex(m.first, m.second))
 *             ret.append(tmp)
 */
    __pyx_t_4 = __pyx_v_c.begin();
    for (;;) {
      if (!(__pyx_t_4 != __pyx_v_c.end())) break;
      __pyx_t_5 = *__pyx_t_4;
      ++__pyx_t_4;
      __pyx_v_m = __pyx_t_5;

      /* "src/clustering.pyx":76
 *             tmp = []
 *             for m in c:
 *                 tmp.append(WeightedIndex(m.first, m.second))             # <<<<<<<<<<<<<<
 *             ret.append(tmp)
 *         return ret
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_WeightedIndex); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_m.first); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_m.second); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 76, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
        __pyx_t_7 = 0;
        __pyx_t_8 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_tmp, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "src/clustering.pyx":75
 *         for c in r:
 *             tmp = []
 *             for m in c:             # <<<<<<<<<<<<<<
 *                 tmp.append(WeightedIndex(m.first, m.second))
 *             ret.append(tmp)
 */
    }

    /* "src/clustering.pyx":77
 *             for m in c:
 *                 tmp.append(WeightedIndex(m.first, m.second))
 *             ret.append(tmp)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_tmp); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(6, 77, __pyx_L1_error)

    /* "src/clustering.pyx":73
 *         r = self._handle.get_core_members_light()
 *         ret = []
 *         for c in r:             # <<<<<<<<<<<<<<
 *             tmp = []
 *             for m in c:
 */
  }

  /* "src/clustering.pyx":78
 *                 tmp.append(WeightedIndex(m.first, m.second))
 *             ret.append(tmp)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def get_nearest_members_light(self, point):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/clustering.pyx":69
 *         ]
 * 
 *     def get_core_members_light(self):             # <<<<<<<<<<<<<<
 *         cdef vector[vector[pair[double, string]]] r
 *         r = self._handle.get_core_members_light()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper.get_core_members_light", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/clustering.pyx":80
 *         return ret
 * 
 *     def get_nearest_members_light(self, point):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[double, string]] r
 *         cdef datum d
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_21get_nearest_members_light(PyObject *__pyx_v_self, PyObject *__pyx_v_point); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_21get_nearest_members_light(PyObject *__pyx_v_self, PyObject *__pyx_v_point) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nearest_members_light (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_ClusteringWrapper_20get_nearest_members_light(((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_point));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_ClusteringWrapper_20get_nearest_members_light(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *__pyx_v_self, PyObject *__pyx_v_point) {
  std::vector<std::pair<double,std::string> >  __pyx_v_r;
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_v_ret = NULL;
  std::pair<double,std::string>  __pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::pair<double,std::string> > ::iterator __pyx_t_2;
  std::pair<double,std::string>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("get_nearest_members_light", 0);

  /* "src/clustering.pyx":83
 *         cdef vector[pair[double, string]] r
 *         cdef datum d
 *         datum_py2native(point, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.get_nearest_members_light(d)
 *         ret = []
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_point, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/clustering.pyx":84
 *         cdef datum d
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_members_light(d)             # <<<<<<<<<<<<<<
 *         ret = []
 *         for m in r:
 */
  __pyx_v_r = __pyx_v_self->_handle->get_nearest_members_light(__pyx_v_d);

  /* "src/clustering.pyx":85
 *         datum_py2native(point, d)
 *         r = self._handle.get_nearest_members_light(d)
 *         ret = []             # <<<<<<<<<<<<<<
 *         for m in r:
 *             ret.append(WeightedIndex(m.first, m.second))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/clustering.pyx":86
 *         r = self._handle.get_nearest_members_light(d)
 *         ret = []
 *         for m in r:             # <<<<<<<<<<<<<<
 *             ret.append(WeightedIndex(m.first, m.second))
 *         return ret
 */
  __pyx_t_2 = __pyx_v_r.begin();
  for (;;) {
    if (!(__pyx_t_2 != __pyx_v_r.end())) break;
    __pyx_t_3 = *__pyx_t_2;
    ++__pyx_t_2;
    __pyx_v_m = __pyx_t_3;

    /* "src/clustering.pyx":87
 *         ret = []
 *         for m in r:
 *             ret.append(WeightedIndex(m.first, m.second))             # <<<<<<<<<<<<<<
 *         return ret
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_WeightedIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m.first); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_m.second); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(6, 87, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "src/clustering.pyx":86
 *         r = self._handle.get_nearest_members_light(d)
 *         ret = []
 *         for m in r:             # <<<<<<<<<<<<<<
 *             ret.append(WeightedIndex(m.first, m.second))
 *         return ret
 */
  }

  /* "src/clustering.pyx":88
 *         for m in r:
 *             ret.append(WeightedIndex(m.first, m.second))
 *         return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/clustering.pyx":80
 *         return ret
 * 
 *     def get_nearest_members_light(self, point):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[double, string]] r
 *         cdef datum d
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._ClusteringWrapper.get_nearest_members_light", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":4
 *     cdef _NearestNeighbor *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_1__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_16embedded_jubatus_23_NearestNeighborWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self));

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

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

  /* "src/nearest_neighbor.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/nearest_neighbor.pyx":4
 *     cdef _NearestNeighbor *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/nearest_neighbor.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/nearest_neighbor.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/nearest_neighbor.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/nearest_neighbor.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/nearest_neighbor.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/nearest_neighbor.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/nearest_neighbor.pyx":15
 *         typ, ver = b'nearest_neighbor', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_lambda20(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_lambda20 = {"lambda20", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_lambda20, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_lambda20(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda20 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda20(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda20", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(7, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/nearest_neighbor.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_1lambda21(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_1lambda21 = {"lambda21", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_1lambda21, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_1lambda21(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda21 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda21(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda21", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(7, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(7, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 16, __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("embedded_jubatus._NearestNeighborWrapper._init.lambda21", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_2lambda22(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_2lambda22 = {"lambda22", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_2lambda22, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_2lambda22(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda22 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda22(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda22(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda22", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(7, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(7, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper._init.lambda22", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_3lambda23(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_3lambda23 = {"lambda23", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_3lambda23, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init_3lambda23(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda23 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda23(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda23(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda23", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(7, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/nearest_neighbor.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_4_init(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _NearestNeighbor *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_5__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_5__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 11, __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);

  /* "src/nearest_neighbor.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _NearestNeighbor(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'nearest_neighbor', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _NearestNeighbor(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/nearest_neighbor.pyx":13
 *     def _init(self, config):
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_nearest_neighbor;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/nearest_neighbor.pyx":14
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/nearest_neighbor.pyx":15
 *         typ, ver = b'nearest_neighbor', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_lambda20, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/nearest_neighbor.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_1lambda21, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/nearest_neighbor.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_2lambda22, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/nearest_neighbor.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_23_NearestNeighborWrapper_5_init_3lambda23, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/nearest_neighbor.pyx":15
 *         typ, ver = b'nearest_neighbor', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _NearestNeighbor(config)
 *         typ, ver = b'nearest_neighbor', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":22
 *         )
 * 
 *     def set_row(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_7set_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_7set_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_row (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_row,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_row", 1, 2, 2, 1); __PYX_ERR(7, 22, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_row") < 0)) __PYX_ERR(7, 22, __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_id_ = values[0];
    __pyx_v_row = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_row", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 22, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.set_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_6set_row(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_row);

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_6set_row(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("set_row", 0);

  /* "src/nearest_neighbor.pyx":24
 *     def set_row(self, id_, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         self._handle.set_row(id_.encode('utf8'), d)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/nearest_neighbor.pyx":25
 *         cdef datum d
 *         datum_py2native(row, d)
 *         self._handle.set_row(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_handle->set_row(__pyx_t_3, __pyx_v_d);

  /* "src/nearest_neighbor.pyx":26
 *         datum_py2native(row, d)
 *         self._handle.set_row(id_.encode('utf8'), d)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def neighbor_row_from_id(self, id_, size):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":22
 *         )
 * 
 *     def set_row(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/nearest_neighbor.pyx":28
 *         return True
 * 
 *     def neighbor_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_9neighbor_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_9neighbor_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("neighbor_row_from_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("neighbor_row_from_id", 1, 2, 2, 1); __PYX_ERR(7, 28, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "neighbor_row_from_id") < 0)) __PYX_ERR(7, 28, __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_id_ = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("neighbor_row_from_id", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 28, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.neighbor_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_8neighbor_row_from_id(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_8neighbor_row_from_id(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size) {
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("neighbor_row_from_id", 0);

  /* "src/nearest_neighbor.pyx":30
 *     def neighbor_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 30, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->neighbor_row_from_id(__pyx_t_3, __pyx_t_4);

  /* "src/nearest_neighbor.pyx":31
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)
 *         return [             # <<<<<<<<<<<<<<
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "src/nearest_neighbor.pyx":33
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_4 = __pyx_v_ret.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/nearest_neighbor.pyx":32
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NNIdWithScore); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 32, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 32, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(7, 31, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":28
 *         return True
 * 
 *     def neighbor_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.neighbor_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":36
 *         ]
 * 
 *     def neighbor_row_from_datum(self, dat, size):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_11neighbor_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_11neighbor_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dat = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("neighbor_row_from_datum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dat,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("neighbor_row_from_datum", 1, 2, 2, 1); __PYX_ERR(7, 36, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "neighbor_row_from_datum") < 0)) __PYX_ERR(7, 36, __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_dat = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("neighbor_row_from_datum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 36, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.neighbor_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_10neighbor_row_from_datum(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), __pyx_v_dat, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_10neighbor_row_from_datum(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_size) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("neighbor_row_from_datum", 0);

  /* "src/nearest_neighbor.pyx":39
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 *         datum_py2native(dat, d)             # <<<<<<<<<<<<<<
 *         ret = self._handle.neighbor_row_from_datum(d, size)
 *         return [
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_dat, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/nearest_neighbor.pyx":40
 *         cdef vector[pair[string, float]] ret
 *         datum_py2native(dat, d)
 *         ret = self._handle.neighbor_row_from_datum(d, size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 40, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->neighbor_row_from_datum(__pyx_v_d, __pyx_t_2);

  /* "src/nearest_neighbor.pyx":41
 *         datum_py2native(dat, d)
 *         ret = self._handle.neighbor_row_from_datum(d, size)
 *         return [             # <<<<<<<<<<<<<<
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "src/nearest_neighbor.pyx":43
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/nearest_neighbor.pyx":42
 *         ret = self._handle.neighbor_row_from_datum(d, size)
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NNIdWithScore); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 42, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 42, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(7, 41, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":36
 *         ]
 * 
 *     def neighbor_row_from_datum(self, dat, size):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.neighbor_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":46
 *         ]
 * 
 *     def similar_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_13similar_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_13similar_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("similar_row_from_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("similar_row_from_id", 1, 2, 2, 1); __PYX_ERR(7, 46, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_row_from_id") < 0)) __PYX_ERR(7, 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_id_ = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("similar_row_from_id", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 46, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.similar_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_12similar_row_from_id(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_12similar_row_from_id(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size) {
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("similar_row_from_id", 0);

  /* "src/nearest_neighbor.pyx":48
 *     def similar_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 48, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->similar_row_from_id(__pyx_t_3, __pyx_t_4);

  /* "src/nearest_neighbor.pyx":49
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 *         return [             # <<<<<<<<<<<<<<
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "src/nearest_neighbor.pyx":51
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_4 = __pyx_v_ret.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/nearest_neighbor.pyx":50
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NNIdWithScore); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 50, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 50, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(7, 49, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":46
 *         ]
 * 
 *     def similar_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.similar_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":54
 *         ]
 * 
 *     def similar_row_from_datum(self, dat, size):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_15similar_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_15similar_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dat = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("similar_row_from_datum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dat,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("similar_row_from_datum", 1, 2, 2, 1); __PYX_ERR(7, 54, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_row_from_datum") < 0)) __PYX_ERR(7, 54, __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_dat = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("similar_row_from_datum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 54, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.similar_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_14similar_row_from_datum(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self), __pyx_v_dat, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_14similar_row_from_datum(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self, PyObject *__pyx_v_dat, PyObject *__pyx_v_size) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("similar_row_from_datum", 0);

  /* "src/nearest_neighbor.pyx":57
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 *         datum_py2native(dat, d)             # <<<<<<<<<<<<<<
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_dat, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/nearest_neighbor.pyx":58
 *         cdef vector[pair[string, float]] ret
 *         datum_py2native(dat, d)
 *         ret = self._handle.similar_row_from_datum(d, size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 58, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->similar_row_from_datum(__pyx_v_d, __pyx_t_2);

  /* "src/nearest_neighbor.pyx":59
 *         datum_py2native(dat, d)
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [             # <<<<<<<<<<<<<<
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "src/nearest_neighbor.pyx":61
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/nearest_neighbor.pyx":60
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NNIdWithScore); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 60, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 60, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 60, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 60, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(7, 59, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":54
 *         ]
 * 
 *     def similar_row_from_datum(self, dat, size):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef vector[pair[string, float]] ret
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("embedded_jubatus._NearestNeighborWrapper.similar_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/nearest_neighbor.pyx":64
 *         ]
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_17get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_17get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_rows (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_16get_all_rows(((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_23_NearestNeighborWrapper_16get_all_rows(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_all_rows", 0);

  /* "src/nearest_neighbor.pyx":65
 * 
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()             # <<<<<<<<<<<<<<
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */
  __pyx_v_ret = __pyx_v_self->_handle->get_all_rows();

  /* "src/nearest_neighbor.pyx":66
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __Pyx_decode_cpp_string(((std::string)(__pyx_v_ret[__pyx_v_i])), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(7, 66, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/nearest_neighbor.pyx":64
 *         ]
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

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

/* "src/recommender.pyx":4
 *     cdef _Recommender *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_19_RecommenderWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_19_RecommenderWrapper_1__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_16embedded_jubatus_19_RecommenderWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self));

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

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

  /* "src/recommender.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/recommender.pyx":4
 *     cdef _Recommender *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/recommender.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_19_RecommenderWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_19_RecommenderWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/recommender.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/recommender.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/recommender.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/recommender.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/recommender.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/recommender.pyx":15
 *         typ, ver = b'recommender', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_lambda24(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_lambda24 = {"lambda24", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_lambda24, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_lambda24(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda24 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda24(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda24(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda24", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(8, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/recommender.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_1lambda25(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_1lambda25 = {"lambda25", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_1lambda25, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_1lambda25(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda25 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda25(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda25(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda25", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(8, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(8, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 16, __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("embedded_jubatus._RecommenderWrapper._init.lambda25", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/recommender.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_2lambda26(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_2lambda26 = {"lambda26", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_2lambda26, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_2lambda26(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda26 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda26(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda26(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda26", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(8, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(8, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper._init.lambda26", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/recommender.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_3lambda27(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_3lambda27 = {"lambda27", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_3lambda27, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init_3lambda27(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda27 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda27(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda27(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda27", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(8, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/recommender.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_4_init(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Recommender *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_6__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_6__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 11, __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);

  /* "src/recommender.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Recommender(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'recommender', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Recommender(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(8, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/recommender.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_recommender;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/recommender.pyx":14
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/recommender.pyx":15
 *         typ, ver = b'recommender', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_lambda24, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/recommender.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_1lambda25, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/recommender.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_2lambda26, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/recommender.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_19_RecommenderWrapper_5_init_3lambda27, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/recommender.pyx":15
 *         typ, ver = b'recommender', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Recommender(config)
 *         typ, ver = b'recommender', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/recommender.pyx":22
 *         )
 * 
 *     def clear_row(self, id_):             # <<<<<<<<<<<<<<
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_7clear_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_7clear_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_row (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_6clear_row(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_id_));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_6clear_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("clear_row", 0);

  /* "src/recommender.pyx":23
 * 
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_handle->clear_row(__pyx_t_3);

  /* "src/recommender.pyx":24
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def update_row(self, id_, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/recommender.pyx":22
 *         )
 * 
 *     def clear_row(self, id_):             # <<<<<<<<<<<<<<
 *         self._handle.clear_row(id_.encode('utf8'))
 *         return True
 */

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

/* "src/recommender.pyx":26
 *         return True
 * 
 *     def update_row(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_9update_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_9update_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_row (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_row,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update_row", 1, 2, 2, 1); __PYX_ERR(8, 26, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_row") < 0)) __PYX_ERR(8, 26, __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_id_ = values[0];
    __pyx_v_row = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update_row", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 26, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.update_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_8update_row(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_row);

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_8update_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("update_row", 0);

  /* "src/recommender.pyx":28
 *     def update_row(self, id_, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         self._handle.update_row(id_.encode('utf8'), d)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":29
 *         cdef datum d
 *         datum_py2native(row, d)
 *         self._handle.update_row(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_handle->update_row(__pyx_t_3, __pyx_v_d);

  /* "src/recommender.pyx":30
 *         datum_py2native(row, d)
 *         self._handle.update_row(id_.encode('utf8'), d)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def complete_row_from_id(self, id_):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/recommender.pyx":26
 *         return True
 * 
 *     def update_row(self, id_, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/recommender.pyx":32
 *         return True
 * 
 *     def complete_row_from_id(self, id_):             # <<<<<<<<<<<<<<
 *         cdef datum d = self._handle.complete_row_from_id(id_.encode('utf8'))
 *         return datum_native2py(d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_11complete_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_11complete_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("complete_row_from_id (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_10complete_row_from_id(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_id_));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_10complete_row_from_id(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("complete_row_from_id", 0);

  /* "src/recommender.pyx":33
 * 
 *     def complete_row_from_id(self, id_):
 *         cdef datum d = self._handle.complete_row_from_id(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return datum_native2py(d)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_d = __pyx_v_self->_handle->complete_row_from_id(__pyx_t_3);

  /* "src/recommender.pyx":34
 *     def complete_row_from_id(self, id_):
 *         cdef datum d = self._handle.complete_row_from_id(id_.encode('utf8'))
 *         return datum_native2py(d)             # <<<<<<<<<<<<<<
 * 
 *     def complete_row_from_datum(self, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_16embedded_jubatus_datum_native2py(__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":32
 *         return True
 * 
 *     def complete_row_from_id(self, id_):             # <<<<<<<<<<<<<<
 *         cdef datum d = self._handle.complete_row_from_id(id_.encode('utf8'))
 *         return datum_native2py(d)
 */

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

/* "src/recommender.pyx":36
 *         return datum_native2py(d)
 * 
 *     def complete_row_from_datum(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d0
 *         datum_py2native(row, d0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_13complete_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_v_row); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_13complete_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_v_row) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("complete_row_from_datum (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_12complete_row_from_datum(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_row));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_12complete_row_from_datum(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d0;
  jubatus::core::fv_converter::datum __pyx_v_d1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("complete_row_from_datum", 0);

  /* "src/recommender.pyx":38
 *     def complete_row_from_datum(self, row):
 *         cdef datum d0
 *         datum_py2native(row, d0)             # <<<<<<<<<<<<<<
 *         cdef datum d1 = self._handle.complete_row_from_datum(d0)
 *         return datum_native2py(d1)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":39
 *         cdef datum d0
 *         datum_py2native(row, d0)
 *         cdef datum d1 = self._handle.complete_row_from_datum(d0)             # <<<<<<<<<<<<<<
 *         return datum_native2py(d1)
 * 
 */
  __pyx_v_d1 = __pyx_v_self->_handle->complete_row_from_datum(__pyx_v_d0);

  /* "src/recommender.pyx":40
 *         datum_py2native(row, d0)
 *         cdef datum d1 = self._handle.complete_row_from_datum(d0)
 *         return datum_native2py(d1)             # <<<<<<<<<<<<<<
 * 
 *     def similar_row_from_id(self, id_, size):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_native2py(__pyx_v_d1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":36
 *         return datum_native2py(d)
 * 
 *     def complete_row_from_datum(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d0
 *         datum_py2native(row, d0)
 */

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

/* "src/recommender.pyx":42
 *         return datum_native2py(d1)
 * 
 *     def similar_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_15similar_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_15similar_row_from_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_id_ = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("similar_row_from_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("similar_row_from_id", 1, 2, 2, 1); __PYX_ERR(8, 42, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_row_from_id") < 0)) __PYX_ERR(8, 42, __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_id_ = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("similar_row_from_id", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 42, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.similar_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_14similar_row_from_id(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), __pyx_v_id_, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_14similar_row_from_id(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_, PyObject *__pyx_v_size) {
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("similar_row_from_id", 0);

  /* "src/recommender.pyx":44
 *     def similar_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 44, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->similar_row_from_id(__pyx_t_3, __pyx_t_4);

  /* "src/recommender.pyx":45
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 *         return [             # <<<<<<<<<<<<<<
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "src/recommender.pyx":47
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_4 = __pyx_v_ret.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "src/recommender.pyx":46
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecommenderIdWithScore); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 46, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 46, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(8, 45, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":42
 *         return datum_native2py(d1)
 * 
 *     def similar_row_from_id(self, id_, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.similar_row_from_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/recommender.pyx":50
 *         ]
 * 
 *     def similar_row_from_datum(self, row, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         cdef datum d
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_17similar_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_17similar_row_from_datum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("similar_row_from_datum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("similar_row_from_datum", 1, 2, 2, 1); __PYX_ERR(8, 50, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_row_from_datum") < 0)) __PYX_ERR(8, 50, __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_row = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("similar_row_from_datum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.similar_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_16similar_row_from_datum(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), __pyx_v_row, __pyx_v_size);

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_16similar_row_from_datum(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_size) {
  std::vector<std::pair<std::string,float> >  __pyx_v_ret;
  jubatus::core::fv_converter::datum __pyx_v_d;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("similar_row_from_datum", 0);

  /* "src/recommender.pyx":53
 *         cdef vector[pair[string, float]] ret
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":54
 *         cdef datum d
 *         datum_py2native(row, d)
 *         ret = self._handle.similar_row_from_datum(d, size)             # <<<<<<<<<<<<<<
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 54, __pyx_L1_error)
  __pyx_v_ret = __pyx_v_self->_handle->similar_row_from_datum(__pyx_v_d, __pyx_t_2);

  /* "src/recommender.pyx":55
 *         datum_py2native(row, d)
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [             # <<<<<<<<<<<<<<
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "src/recommender.pyx":57
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 *             for i in range(ret.size())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/recommender.pyx":56
 *         ret = self._handle.similar_row_from_datum(d, size)
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)             # <<<<<<<<<<<<<<
 *             for i in range(ret.size())
 *         ]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RecommenderIdWithScore); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_decode_cpp_string((__pyx_v_ret[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_ret[__pyx_v_i]).second); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(8, 55, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":50
 *         ]
 * 
 *     def similar_row_from_datum(self, row, size):             # <<<<<<<<<<<<<<
 *         cdef vector[pair[string, float]] ret
 *         cdef datum d
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.similar_row_from_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/recommender.pyx":60
 *         ]
 * 
 *     def decode_row(self, id_):             # <<<<<<<<<<<<<<
 *         cdef datum d = self._handle.decode_row(id_.encode('utf8'))
 *         return datum_native2py(d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_19decode_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_19decode_row(PyObject *__pyx_v_self, PyObject *__pyx_v_id_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode_row (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_18decode_row(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_id_));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_18decode_row(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_id_) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("decode_row", 0);

  /* "src/recommender.pyx":61
 * 
 *     def decode_row(self, id_):
 *         cdef datum d = self._handle.decode_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return datum_native2py(d)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_id_, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_d = __pyx_v_self->_handle->decode_row(__pyx_t_3);

  /* "src/recommender.pyx":62
 *     def decode_row(self, id_):
 *         cdef datum d = self._handle.decode_row(id_.encode('utf8'))
 *         return datum_native2py(d)             # <<<<<<<<<<<<<<
 * 
 *     def get_all_rows(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_16embedded_jubatus_datum_native2py(__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":60
 *         ]
 * 
 *     def decode_row(self, id_):             # <<<<<<<<<<<<<<
 *         cdef datum d = self._handle.decode_row(id_.encode('utf8'))
 *         return datum_native2py(d)
 */

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

/* "src/recommender.pyx":64
 *         return datum_native2py(d)
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_21get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_21get_all_rows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_all_rows (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_20get_all_rows(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_20get_all_rows(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_ret;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_all_rows", 0);

  /* "src/recommender.pyx":65
 * 
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()             # <<<<<<<<<<<<<<
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 * 
 */
  __pyx_v_ret = __pyx_v_self->_handle->get_all_rows();

  /* "src/recommender.pyx":66
 *     def get_all_rows(self):
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]             # <<<<<<<<<<<<<<
 * 
 *     def calc_similarity(self, l, r):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_ret.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __Pyx_decode_cpp_string(((std::string)(__pyx_v_ret[__pyx_v_i])), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(8, 66, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":64
 *         return datum_native2py(d)
 * 
 *     def get_all_rows(self):             # <<<<<<<<<<<<<<
 *         cdef vector[string] ret = self._handle.get_all_rows()
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 */

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

/* "src/recommender.pyx":68
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 * 
 *     def calc_similarity(self, l, r):             # <<<<<<<<<<<<<<
 *         cdef datum d0
 *         cdef datum d1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_23calc_similarity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_23calc_similarity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_l = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calc_similarity (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_r,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("calc_similarity", 1, 2, 2, 1); __PYX_ERR(8, 68, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_similarity") < 0)) __PYX_ERR(8, 68, __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_l = values[0];
    __pyx_v_r = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("calc_similarity", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 68, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._RecommenderWrapper.calc_similarity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_22calc_similarity(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), __pyx_v_l, __pyx_v_r);

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_22calc_similarity(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r) {
  jubatus::core::fv_converter::datum __pyx_v_d0;
  jubatus::core::fv_converter::datum __pyx_v_d1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("calc_similarity", 0);

  /* "src/recommender.pyx":71
 *         cdef datum d0
 *         cdef datum d1
 *         datum_py2native(l, d0)             # <<<<<<<<<<<<<<
 *         datum_py2native(r, d1)
 *         return self._handle.calc_similarity(d0, d1)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_l, __pyx_v_d0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":72
 *         cdef datum d1
 *         datum_py2native(l, d0)
 *         datum_py2native(r, d1)             # <<<<<<<<<<<<<<
 *         return self._handle.calc_similarity(d0, d1)
 * 
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_r, __pyx_v_d1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":73
 *         datum_py2native(l, d0)
 *         datum_py2native(r, d1)
 *         return self._handle.calc_similarity(d0, d1)             # <<<<<<<<<<<<<<
 * 
 *     def calc_l2norm(self, row):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_handle->calc_similarity(__pyx_v_d0, __pyx_v_d1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":68
 *         return [(<string>ret[i]).decode('utf8') for i in range(ret.size())]
 * 
 *     def calc_similarity(self, l, r):             # <<<<<<<<<<<<<<
 *         cdef datum d0
 *         cdef datum d1
 */

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

/* "src/recommender.pyx":75
 *         return self._handle.calc_similarity(d0, d1)
 * 
 *     def calc_l2norm(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_25calc_l2norm(PyObject *__pyx_v_self, PyObject *__pyx_v_row); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_25calc_l2norm(PyObject *__pyx_v_self, PyObject *__pyx_v_row) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calc_l2norm (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_19_RecommenderWrapper_24calc_l2norm(((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_row));

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

static PyObject *__pyx_pf_16embedded_jubatus_19_RecommenderWrapper_24calc_l2norm(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *__pyx_v_self, PyObject *__pyx_v_row) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("calc_l2norm", 0);

  /* "src/recommender.pyx":77
 *     def calc_l2norm(self, row):
 *         cdef datum d
 *         datum_py2native(row, d)             # <<<<<<<<<<<<<<
 *         return self._handle.calc_l2norm(d)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_row, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/recommender.pyx":78
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.calc_l2norm(d)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_handle->calc_l2norm(__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/recommender.pyx":75
 *         return self._handle.calc_similarity(d0, d1)
 * 
 *     def calc_l2norm(self, row):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         datum_py2native(row, d)
 */

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

/* "src/regression.pyx":4
 *     cdef _Regression *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_18_RegressionWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_18_RegressionWrapper_1__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_16embedded_jubatus_18_RegressionWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)__pyx_v_self));

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

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

  /* "src/regression.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/regression.pyx":4
 *     cdef _Regression *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/regression.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_18_RegressionWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_18_RegressionWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_18_RegressionWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_18_RegressionWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/regression.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/regression.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/regression.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/regression.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/regression.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_RegressionWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/regression.pyx":15
 *         typ, ver = b'regression', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_lambda28(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_lambda28 = {"lambda28", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_lambda28, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_lambda28(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda28 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda28(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda28(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda28", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(9, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/regression.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_1lambda29(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_1lambda29 = {"lambda29", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_1lambda29, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_1lambda29(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda29 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda29(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda29(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda29", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(9, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(9, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 16, __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("embedded_jubatus._RegressionWrapper._init.lambda29", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/regression.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_2lambda30(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_2lambda30 = {"lambda30", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_2lambda30, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_2lambda30(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda30 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda30(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda30(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda30", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(9, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(9, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._RegressionWrapper._init.lambda30", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/regression.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_3lambda31(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_3lambda31 = {"lambda31", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_3lambda31, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init_3lambda31(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda31 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda31(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda31(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda31", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(9, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/regression.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_4_init(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Regression *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_7__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_7__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(9, 11, __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);

  /* "src/regression.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Regression(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'regression', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Regression(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/regression.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_regression;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/regression.pyx":14
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/regression.pyx":15
 *         typ, ver = b'regression', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_lambda28, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/regression.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_1lambda29, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/regression.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_2lambda30, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/regression.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_18_RegressionWrapper_5_init_3lambda31, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/regression.pyx":15
 *         typ, ver = b'regression', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/regression.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Regression(config)
 *         typ, ver = b'regression', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._RegressionWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/regression.pyx":22
 *         )
 * 
 *     def train(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         if isinstance(data, list):
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_7train(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_7train(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_RegressionWrapper_6train(((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_6train(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_score = NULL;
  PyObject *__pyx_v_datum = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  float __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  double __pyx_t_13;
  __Pyx_RefNannySetupContext("train", 0);

  /* "src/regression.pyx":24
 *     def train(self, data):
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             if len(data) == 0:
 *                 return 0
 */
  __pyx_t_1 = PyList_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/regression.pyx":25
 *         cdef datum d
 *         if isinstance(data, list):
 *             if len(data) == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(9, 25, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_3 == 0) != 0);
    if (__pyx_t_2) {

      /* "src/regression.pyx":26
 *         if isinstance(data, list):
 *             if len(data) == 0:
 *                 return 0             # <<<<<<<<<<<<<<
 *             if isinstance(data[0], ScoredDatum):
 *                 for r in data:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_int_0);
      __pyx_r = __pyx_int_0;
      goto __pyx_L0;

      /* "src/regression.pyx":25
 *         cdef datum d
 *         if isinstance(data, list):
 *             if len(data) == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):
 */
    }

    /* "src/regression.pyx":27
 *             if len(data) == 0:
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):             # <<<<<<<<<<<<<<
 *                 for r in data:
 *                     score = float(r.score)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ScoredDatum); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_IsInstance(__pyx_t_4, __pyx_t_5); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(9, 27, __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_t_2 != 0);
    if (__pyx_t_1) {

      /* "src/regression.pyx":28
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):
 *                 for r in data:             # <<<<<<<<<<<<<<
 *                     score = float(r.score)
 *                     datum_py2native(r.data, d)
 */
      if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
        __pyx_t_5 = __pyx_v_data; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 28, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 28, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(9, 28, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 28, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(9, 28, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 28, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_6(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(9, 28, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "src/regression.pyx":29
 *             if isinstance(data[0], ScoredDatum):
 *                 for r in data:
 *                     score = float(r.score)             # <<<<<<<<<<<<<<
 *                     datum_py2native(r.data, d)
 *                     self._handle.train(score, d)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_score); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 29, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 29, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "src/regression.pyx":30
 *                 for r in data:
 *                     score = float(r.score)
 *                     datum_py2native(r.data, d)             # <<<<<<<<<<<<<<
 *                     self._handle.train(score, d)
 *             elif isinstance(data[0], (tuple, list)):
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 30, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_t_7, __pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 30, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "src/regression.pyx":31
 *                     score = float(r.score)
 *                     datum_py2native(r.data, d)
 *                     self._handle.train(score, d)             # <<<<<<<<<<<<<<
 *             elif isinstance(data[0], (tuple, list)):
 *                 for score, datum in data:
 */
        __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_score); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 31, __pyx_L1_error)
        __pyx_v_self->_handle->train(__pyx_t_8, __pyx_v_d);

        /* "src/regression.pyx":28
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):
 *                 for r in data:             # <<<<<<<<<<<<<<
 *                     score = float(r.score)
 *                     datum_py2native(r.data, d)
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "src/regression.pyx":27
 *             if len(data) == 0:
 *                 return 0
 *             if isinstance(data[0], ScoredDatum):             # <<<<<<<<<<<<<<
 *                 for r in data:
 *                     score = float(r.score)
 */
      goto __pyx_L5;
    }

    /* "src/regression.pyx":32
 *                     datum_py2native(r.data, d)
 *                     self._handle.train(score, d)
 *             elif isinstance(data[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *                 for score, datum in data:
 *                     datum_py2native(datum, d)
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_Check(__pyx_t_5); 
    __pyx_t_9 = (__pyx_t_2 != 0);
    if (!__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_9 = PyList_Check(__pyx_t_5); 
    __pyx_t_2 = (__pyx_t_9 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "src/regression.pyx":33
 *                     self._handle.train(score, d)
 *             elif isinstance(data[0], (tuple, list)):
 *                 for score, datum in data:             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(float(score), d)
 */
      if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
        __pyx_t_5 = __pyx_v_data; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 33, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(9, 33, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 33, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(9, 33, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 33, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_6(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(9, 33, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
          PyObject* sequence = __pyx_t_4;
          #if !CYTHON_COMPILING_IN_PYPY
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(9, 33, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 33, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 33, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 33, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
          index = 0; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(9, 33, __pyx_L1_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_unpacking_done;
          __pyx_L12_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(9, 33, __pyx_L1_error)
          __pyx_L13_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_datum, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "src/regression.pyx":34
 *             elif isinstance(data[0], (tuple, list)):
 *                 for score, datum in data:
 *                     datum_py2native(datum, d)             # <<<<<<<<<<<<<<
 *                     self._handle.train(float(score), d)
 *             else:
 */
        __pyx_t_4 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_datum, __pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 34, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "src/regression.pyx":35
 *                 for score, datum in data:
 *                     datum_py2native(datum, d)
 *                     self._handle.train(float(score), d)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError
 */
        __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_v_score); if (unlikely(__pyx_t_13 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(9, 35, __pyx_L1_error)
        __pyx_v_self->_handle->train(__pyx_t_13, __pyx_v_d);

        /* "src/regression.pyx":33
 *                     self._handle.train(score, d)
 *             elif isinstance(data[0], (tuple, list)):
 *                 for score, datum in data:             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(float(score), d)
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "src/regression.pyx":32
 *                     datum_py2native(r.data, d)
 *                     self._handle.train(score, d)
 *             elif isinstance(data[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *                 for score, datum in data:
 *                     datum_py2native(datum, d)
 */
      goto __pyx_L5;
    }

    /* "src/regression.pyx":37
 *                     self._handle.train(float(score), d)
 *             else:
 *                 raise ValueError             # <<<<<<<<<<<<<<
 *             return len(data)
 *         else:
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
      __PYX_ERR(9, 37, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "src/regression.pyx":38
 *             else:
 *                 raise ValueError
 *             return len(data)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(9, 38, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "src/regression.pyx":24
 *     def train(self, data):
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             if len(data) == 0:
 *                 return 0
 */
  }

  /* "src/regression.pyx":40
 *             return len(data)
 *         else:
 *             raise ValueError             # <<<<<<<<<<<<<<
 * 
 *     def estimate(self, data):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(9, 40, __pyx_L1_error)
  }

  /* "src/regression.pyx":22
 *         )
 * 
 *     def train(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         if isinstance(data, list):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("embedded_jubatus._RegressionWrapper.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_score);
  __Pyx_XDECREF(__pyx_v_datum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/regression.pyx":42
 *             raise ValueError
 * 
 *     def estimate(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         if isinstance(data, list):
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_9estimate(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_18_RegressionWrapper_9estimate(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("estimate (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_18_RegressionWrapper_8estimate(((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_18_RegressionWrapper_8estimate(struct __pyx_obj_16embedded_jubatus__RegressionWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_datum = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("estimate", 0);

  /* "src/regression.pyx":44
 *     def estimate(self, data):
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             ret = []
 *             for datum in data:
 */
  __pyx_t_1 = PyList_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/regression.pyx":45
 *         cdef datum d
 *         if isinstance(data, list):
 *             ret = []             # <<<<<<<<<<<<<<
 *             for datum in data:
 *                 datum_py2native(datum, d)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ret = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "src/regression.pyx":46
 *         if isinstance(data, list):
 *             ret = []
 *             for datum in data:             # <<<<<<<<<<<<<<
 *                 datum_py2native(datum, d)
 *                 ret.append(self._handle.estimate(d))
 */
    if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
      __pyx_t_3 = __pyx_v_data; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 46, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(9, 46, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_datum, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "src/regression.pyx":47
 *             ret = []
 *             for datum in data:
 *                 datum_py2native(datum, d)             # <<<<<<<<<<<<<<
 *                 ret.append(self._handle.estimate(d))
 *             return ret
 */
      __pyx_t_6 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_datum, __pyx_v_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "src/regression.pyx":48
 *             for datum in data:
 *                 datum_py2native(datum, d)
 *                 ret.append(self._handle.estimate(d))             # <<<<<<<<<<<<<<
 *             return ret
 *         else:
 */
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->_handle->estimate(__pyx_v_d)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(9, 48, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "src/regression.pyx":46
 *         if isinstance(data, list):
 *             ret = []
 *             for datum in data:             # <<<<<<<<<<<<<<
 *                 datum_py2native(datum, d)
 *                 ret.append(self._handle.estimate(d))
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "src/regression.pyx":49
 *                 datum_py2native(datum, d)
 *                 ret.append(self._handle.estimate(d))
 *             return ret             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_ret);
    __pyx_r = __pyx_v_ret;
    goto __pyx_L0;

    /* "src/regression.pyx":44
 *     def estimate(self, data):
 *         cdef datum d
 *         if isinstance(data, list):             # <<<<<<<<<<<<<<
 *             ret = []
 *             for datum in data:
 */
  }

  /* "src/regression.pyx":51
 *             return ret
 *         else:
 *             raise ValueError             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(9, 51, __pyx_L1_error)
  }

  /* "src/regression.pyx":42
 *             raise ValueError
 * 
 *     def estimate(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         if isinstance(data, list):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("embedded_jubatus._RegressionWrapper.estimate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_datum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/stat.pyx":4
 *     cdef _Stat *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_12_StatWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_12_StatWrapper_1__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_16embedded_jubatus_12_StatWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self));

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

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

  /* "src/stat.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/stat.pyx":4
 *     cdef _Stat *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/stat.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_12_StatWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_12_StatWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_12_StatWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_12_StatWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/stat.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/stat.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/stat.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/stat.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/stat.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/stat.pyx":15
 *         typ, ver = b'stat', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_lambda32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_lambda32 = {"lambda32", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_lambda32, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_lambda32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda32 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda32(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda32(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda32", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(10, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/stat.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_1lambda33(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_1lambda33 = {"lambda33", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_1lambda33, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_1lambda33(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda33 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda33(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda33(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda33", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(10, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(10, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 16, __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("embedded_jubatus._StatWrapper._init.lambda33", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/stat.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_2lambda34(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_2lambda34 = {"lambda34", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_2lambda34, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_2lambda34(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda34 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda34(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda34(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda34", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(10, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(10, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._StatWrapper._init.lambda34", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/stat.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_3lambda35(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_3lambda35 = {"lambda35", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_3lambda35, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init_3lambda35(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda35 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda35(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda35(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda35", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(10, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/stat.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_4_init(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Stat *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_8__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_8__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 11, __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);

  /* "src/stat.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Stat(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'stat', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Stat(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/stat.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_stat;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/stat.pyx":14
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/stat.pyx":15
 *         typ, ver = b'stat', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_lambda32, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/stat.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_1lambda33, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/stat.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_2lambda34, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/stat.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_StatWrapper_5_init_3lambda35, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/stat.pyx":15
 *         typ, ver = b'stat', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Stat(config)
 *         typ, ver = b'stat', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._StatWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/stat.pyx":22
 *         )
 * 
 *     def push(self, key, value):             # <<<<<<<<<<<<<<
 *         self._handle.push(key.encode('utf8'), value)
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_7push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_7push(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("push (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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("push", 1, 2, 2, 1); __PYX_ERR(10, 22, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(10, 22, __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("push", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 22, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._StatWrapper.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_6push(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_6push(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  double __pyx_t_4;
  __Pyx_RefNannySetupContext("push", 0);

  /* "src/stat.pyx":23
 * 
 *     def push(self, key, value):
 *         self._handle.push(key.encode('utf8'), value)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 23, __pyx_L1_error)
  __pyx_v_self->_handle->push(__pyx_t_3, __pyx_t_4);

  /* "src/stat.pyx":24
 *     def push(self, key, value):
 *         self._handle.push(key.encode('utf8'), value)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def sum(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/stat.pyx":22
 *         )
 * 
 *     def push(self, key, value):             # <<<<<<<<<<<<<<
 *         self._handle.push(key.encode('utf8'), value)
 *         return True
 */

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

/* "src/stat.pyx":26
 *         return True
 * 
 *     def sum(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.sum(key.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_9sum(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_9sum(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sum (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_8sum(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_8sum(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("sum", 0);

  /* "src/stat.pyx":27
 * 
 *     def sum(self, key):
 *         return self._handle.sum(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def stddev(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->sum(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":26
 *         return True
 * 
 *     def sum(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.sum(key.encode('utf8'))
 * 
 */

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

/* "src/stat.pyx":29
 *         return self._handle.sum(key.encode('utf8'))
 * 
 *     def stddev(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.stddev(key.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_11stddev(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_11stddev(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stddev (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_10stddev(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_10stddev(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("stddev", 0);

  /* "src/stat.pyx":30
 * 
 *     def stddev(self, key):
 *         return self._handle.stddev(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def max(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->stddev(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":29
 *         return self._handle.sum(key.encode('utf8'))
 * 
 *     def stddev(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.stddev(key.encode('utf8'))
 * 
 */

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

/* "src/stat.pyx":32
 *         return self._handle.stddev(key.encode('utf8'))
 * 
 *     def max(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.max(key.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_13max(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_13max(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_12max(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_12max(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("max", 0);

  /* "src/stat.pyx":33
 * 
 *     def max(self, key):
 *         return self._handle.max(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def min(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->max(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":32
 *         return self._handle.stddev(key.encode('utf8'))
 * 
 *     def max(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.max(key.encode('utf8'))
 * 
 */

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

/* "src/stat.pyx":35
 *         return self._handle.max(key.encode('utf8'))
 * 
 *     def min(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.min(key.encode('utf8'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_15min(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_15min(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("min (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_14min(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_14min(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("min", 0);

  /* "src/stat.pyx":36
 * 
 *     def min(self, key):
 *         return self._handle.min(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def entropy(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->min(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":35
 *         return self._handle.max(key.encode('utf8'))
 * 
 *     def min(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.min(key.encode('utf8'))
 * 
 */

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

/* "src/stat.pyx":38
 *         return self._handle.min(key.encode('utf8'))
 * 
 *     def entropy(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.entropy()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_17entropy(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_17entropy(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("entropy (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_16entropy(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_16entropy(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("entropy", 0);

  /* "src/stat.pyx":39
 * 
 *     def entropy(self, key):
 *         return self._handle.entropy()             # <<<<<<<<<<<<<<
 * 
 *     def moment(self, key, degree, center):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_handle->entropy()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":38
 *         return self._handle.min(key.encode('utf8'))
 * 
 *     def entropy(self, key):             # <<<<<<<<<<<<<<
 *         return self._handle.entropy()
 * 
 */

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

/* "src/stat.pyx":41
 *         return self._handle.entropy()
 * 
 *     def moment(self, key, degree, center):             # <<<<<<<<<<<<<<
 *         return self._handle.moment(key.encode('utf8'), degree, center)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_19moment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_12_StatWrapper_19moment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_degree = 0;
  PyObject *__pyx_v_center = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_degree,&__pyx_n_s_center,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("moment", 1, 3, 3, 1); __PYX_ERR(10, 41, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("moment", 1, 3, 3, 2); __PYX_ERR(10, 41, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "moment") < 0)) __PYX_ERR(10, 41, __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_key = values[0];
    __pyx_v_degree = values[1];
    __pyx_v_center = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("moment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 41, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._StatWrapper.moment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_12_StatWrapper_18moment(((struct __pyx_obj_16embedded_jubatus__StatWrapper *)__pyx_v_self), __pyx_v_key, __pyx_v_degree, __pyx_v_center);

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

static PyObject *__pyx_pf_16embedded_jubatus_12_StatWrapper_18moment(struct __pyx_obj_16embedded_jubatus__StatWrapper *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_degree, PyObject *__pyx_v_center) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  __Pyx_RefNannySetupContext("moment", 0);

  /* "src/stat.pyx":42
 * 
 *     def moment(self, key, degree, center):
 *         return self._handle.moment(key.encode('utf8'), degree, center)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_degree); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 42, __pyx_L1_error)
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_center); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(10, 42, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_handle->moment(__pyx_t_3, __pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/stat.pyx":41
 *         return self._handle.entropy()
 * 
 *     def moment(self, key, degree, center):             # <<<<<<<<<<<<<<
 *         return self._handle.moment(key.encode('utf8'), degree, center)
 */

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

/* "src/weight.pyx":4
 *     cdef _Weight *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_14_WeightWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_14_WeightWrapper_1__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_16embedded_jubatus_14_WeightWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)__pyx_v_self));

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

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

  /* "src/weight.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/weight.pyx":4
 *     cdef _Weight *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/weight.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_14_WeightWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_14_WeightWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_14_WeightWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_14_WeightWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/weight.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/weight.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/weight.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/weight.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/weight.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_WeightWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/weight.pyx":15
 *         typ, ver = b'weight', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_lambda36(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_lambda36 = {"lambda36", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_lambda36, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_lambda36(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda36 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda36(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda36(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda36", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(11, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/weight.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_1lambda37(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_1lambda37 = {"lambda37", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_1lambda37, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_1lambda37(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda37 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda37(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda37(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda37", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(11, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(11, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 16, __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("embedded_jubatus._WeightWrapper._init.lambda37", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/weight.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_2lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_2lambda38 = {"lambda38", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_2lambda38, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_2lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda38 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda38(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda38", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(11, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(11, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._WeightWrapper._init.lambda38", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/weight.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_3lambda39(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_3lambda39 = {"lambda39", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_3lambda39, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init_3lambda39(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda39 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda39(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda39", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(11, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/weight.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_4_init(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Weight *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_9__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_9__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(11, 11, __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);

  /* "src/weight.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Weight(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'weight', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Weight(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(11, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/weight.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_weight;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/weight.pyx":14
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/weight.pyx":15
 *         typ, ver = b'weight', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_lambda36, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/weight.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_1lambda37, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/weight.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_2lambda38, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/weight.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_14_WeightWrapper_5_init_3lambda39, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/weight.pyx":15
 *         typ, ver = b'weight', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/weight.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Weight(config)
 *         typ, ver = b'weight', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._WeightWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/weight.pyx":22
 *         )
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef sfv_t r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_7update(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_7update(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_WeightWrapper_6update(((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_6update(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  __pyx_t_8_wrapper_sfv_t __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("update", 0);

  /* "src/weight.pyx":25
 *         cdef datum d
 *         cdef sfv_t r
 *         datum_py2native(data, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.update(d)
 *         return _to_features(r)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_data, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/weight.pyx":26
 *         cdef sfv_t r
 *         datum_py2native(data, d)
 *         r = self._handle.update(d)             # <<<<<<<<<<<<<<
 *         return _to_features(r)
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->update(__pyx_v_d);

  /* "src/weight.pyx":27
 *         datum_py2native(data, d)
 *         r = self._handle.update(d)
 *         return _to_features(r)             # <<<<<<<<<<<<<<
 * 
 *     def calc_weight(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_16embedded_jubatus__to_features(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/weight.pyx":22
 *         )
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef sfv_t r
 */

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

/* "src/weight.pyx":29
 *         return _to_features(r)
 * 
 *     def calc_weight(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef sfv_t r
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_9calc_weight(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_14_WeightWrapper_9calc_weight(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calc_weight (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_14_WeightWrapper_8calc_weight(((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_16embedded_jubatus_14_WeightWrapper_8calc_weight(struct __pyx_obj_16embedded_jubatus__WeightWrapper *__pyx_v_self, PyObject *__pyx_v_data) {
  jubatus::core::fv_converter::datum __pyx_v_d;
  __pyx_t_8_wrapper_sfv_t __pyx_v_r;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("calc_weight", 0);

  /* "src/weight.pyx":32
 *         cdef datum d
 *         cdef sfv_t r
 *         datum_py2native(data, d)             # <<<<<<<<<<<<<<
 *         r = self._handle.calc_weight(d)
 *         return _to_features(r)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_datum_py2native(__pyx_v_data, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/weight.pyx":33
 *         cdef sfv_t r
 *         datum_py2native(data, d)
 *         r = self._handle.calc_weight(d)             # <<<<<<<<<<<<<<
 *         return _to_features(r)
 * 
 */
  __pyx_v_r = __pyx_v_self->_handle->calc_weight(__pyx_v_d);

  /* "src/weight.pyx":34
 *         datum_py2native(data, d)
 *         r = self._handle.calc_weight(d)
 *         return _to_features(r)             # <<<<<<<<<<<<<<
 * 
 * cdef _to_features(sfv_t& r):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_16embedded_jubatus__to_features(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/weight.pyx":29
 *         return _to_features(r)
 * 
 *     def calc_weight(self, data):             # <<<<<<<<<<<<<<
 *         cdef datum d
 *         cdef sfv_t r
 */

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

/* "src/weight.pyx":36
 *         return _to_features(r)
 * 
 * cdef _to_features(sfv_t& r):             # <<<<<<<<<<<<<<
 *     ret = [None] * r.size()
 *     for i in range(r.size()):
 */

static PyObject *__pyx_f_16embedded_jubatus__to_features(__pyx_t_8_wrapper_sfv_t &__pyx_v_r) {
  PyObject *__pyx_v_ret = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_to_features", 0);

  /* "src/weight.pyx":37
 * 
 * cdef _to_features(sfv_t& r):
 *     ret = [None] * r.size()             # <<<<<<<<<<<<<<
 *     for i in range(r.size()):
 *         ret[i] = Feature(r[i].first.decode('utf8'),
 */
  __pyx_t_1 = PyList_New(1 * (__pyx_v_r.size())); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_r.size(); __pyx_temp++) {
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None);
    }
  }
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/weight.pyx":38
 * cdef _to_features(sfv_t& r):
 *     ret = [None] * r.size()
 *     for i in range(r.size()):             # <<<<<<<<<<<<<<
 *         ret[i] = Feature(r[i].first.decode('utf8'),
 *                          r[i].second)
 */
  __pyx_t_2 = __pyx_v_r.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "src/weight.pyx":39
 *     ret = [None] * r.size()
 *     for i in range(r.size()):
 *         ret[i] = Feature(r[i].first.decode('utf8'),             # <<<<<<<<<<<<<<
 *                          r[i].second)
 *     return ret
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Feature); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_decode_cpp_string((__pyx_v_r[__pyx_v_i]).first, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "src/weight.pyx":40
 *     for i in range(r.size()):
 *         ret[i] = Feature(r[i].first.decode('utf8'),
 *                          r[i].second)             # <<<<<<<<<<<<<<
 *     return ret
 */
    __pyx_t_6 = PyFloat_FromDouble((__pyx_v_r[__pyx_v_i]).second); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 39, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 39, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "src/weight.pyx":39
 *     ret = [None] * r.size()
 *     for i in range(r.size()):
 *         ret[i] = Feature(r[i].first.decode('utf8'),             # <<<<<<<<<<<<<<
 *                          r[i].second)
 *     return ret
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_ret, __pyx_v_i, __pyx_t_1, size_t, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1) < 0)) __PYX_ERR(11, 39, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "src/weight.pyx":41
 *         ret[i] = Feature(r[i].first.decode('utf8'),
 *                          r[i].second)
 *     return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "src/weight.pyx":36
 *         return _to_features(r)
 * 
 * cdef _to_features(sfv_t& r):             # <<<<<<<<<<<<<<
 *     ret = [None] * r.size()
 *     for i in range(r.size()):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._to_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/graph.pyx":4
 *     cdef _Graph *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_16embedded_jubatus_13_GraphWrapper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_16embedded_jubatus_13_GraphWrapper_1__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_16embedded_jubatus_13_GraphWrapper___cinit__(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self));

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

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

  /* "src/graph.pyx":5
 * 
 *     def __cinit__(self):
 *         self._handle = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_handle = NULL;

  /* "src/graph.pyx":4
 *     cdef _Graph *_handle
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._handle = NULL
 * 
 */

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

/* "src/graph.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

/* Python wrapper */
static void __pyx_pw_16embedded_jubatus_13_GraphWrapper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_16embedded_jubatus_13_GraphWrapper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_16embedded_jubatus_13_GraphWrapper_2__dealloc__(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self));

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

static void __pyx_pf_16embedded_jubatus_13_GraphWrapper_2__dealloc__(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "src/graph.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
  if (__pyx_t_1) {

    /* "src/graph.pyx":9
 *     def __dealloc__(self):
 *         if self._handle != NULL:
 *             del self._handle             # <<<<<<<<<<<<<<
 * 
 *     def _init(self, config):
 */
    delete __pyx_v_self->_handle;

    /* "src/graph.pyx":8
 * 
 *     def __dealloc__(self):
 *         if self._handle != NULL:             # <<<<<<<<<<<<<<
 *             del self._handle
 * 
 */
  }

  /* "src/graph.pyx":7
 *         self._handle = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._handle != NULL:
 *             del self._handle
 */

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

/* "src/graph.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init(PyObject *__pyx_v_self, PyObject *__pyx_v_config) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_4_init(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_config));

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

/* "src/graph.pyx":15
 *         typ, ver = b'graph', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_lambda40(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_lambda40 = {"lambda40", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_lambda40, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_lambda40(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda40 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda40(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda40(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda40", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(12, 15, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_cur_scope->__pyx_v_self->_handle->get_config(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/graph.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_1lambda41(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_1lambda41 = {"lambda41", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_1lambda41, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_1lambda41(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda41 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda41(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda41", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(12, 16, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(12, 16, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_cur_scope->__pyx_v_self->_handle->dump(__pyx_t_1, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 16, __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("embedded_jubatus._GraphWrapper._init.lambda41", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/graph.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_2lambda42(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_2lambda42 = {"lambda42", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_2lambda42, METH_O, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_2lambda42(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda42 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda42(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda42(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda42", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(12, 17, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 17, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_v_typ)) { __Pyx_RaiseClosureNameError("typ"); __PYX_ERR(12, 17, __pyx_L1_error) }
  __pyx_t_2 = __pyx_convert_string_from_py_std__in_string(__pyx_cur_scope->__pyx_v_typ); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 17, __pyx_L1_error)
  __pyx_t_3 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->load(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_ver)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper._init.lambda42", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/graph.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_3lambda43(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_3lambda43 = {"lambda43", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_3lambda43, METH_NOARGS, 0};
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init_3lambda43(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda43 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda43(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda43(PyObject *__pyx_self) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_cur_scope;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda43", 0);
  __pyx_outer_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(12, 18, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_cur_scope->__pyx_v_self->_handle->clear()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "src/graph.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1
 */

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_4_init(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_config) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  _Graph *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_10__init(__pyx_ptype_16embedded_jubatus___pyx_scope_struct_10__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 11, __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);

  /* "src/graph.pyx":12
 * 
 *     def _init(self, config):
 *         self._handle = new _Graph(config)             # <<<<<<<<<<<<<<
 *         typ, ver = b'graph', 1
 *         return (
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_config); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 12, __pyx_L1_error)
  try {
    __pyx_t_2 = new _Graph(__pyx_t_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(12, 12, __pyx_L1_error)
  }
  __pyx_cur_scope->__pyx_v_self->_handle = __pyx_t_2;

  /* "src/graph.pyx":13
 *     def _init(self, config):
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1             # <<<<<<<<<<<<<<
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 */
  __pyx_t_3 = __pyx_n_b_graph;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 1;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_typ = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_ver = __pyx_t_4;

  /* "src/graph.pyx":14
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1
 *         return (             # <<<<<<<<<<<<<<
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "src/graph.pyx":15
 *         typ, ver = b'graph', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_lambda40, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "src/graph.pyx":16
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),             # <<<<<<<<<<<<<<
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_1lambda41, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/graph.pyx":17
 *             lambda: self._handle.get_config().decode('utf8'),
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.clear(),
 *             typ,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_2lambda42, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "src/graph.pyx":18
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 *             lambda: self._handle.clear(),             # <<<<<<<<<<<<<<
 *             typ,
 *         )
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_13_GraphWrapper_5_init_3lambda43, 0, __pyx_n_s_init_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_embedded_jubatus, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "src/graph.pyx":15
 *         typ, ver = b'graph', 1
 *         return (
 *             lambda: self._handle.get_config().decode('utf8'),             # <<<<<<<<<<<<<<
 *             lambda: self._handle.dump(typ, ver),
 *             lambda x: self._handle.load(x, typ, ver),
 */
  __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_typ);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_typ);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":11
 *             del self._handle
 * 
 *     def _init(self, config):             # <<<<<<<<<<<<<<
 *         self._handle = new _Graph(config)
 *         typ, ver = b'graph', 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/graph.pyx":22
 *         )
 * 
 *     def create_node(self):             # <<<<<<<<<<<<<<
 *         return self._handle.create_node().decode('ascii')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_7create_node(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_7create_node(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_node (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_6create_node(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_6create_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("create_node", 0);

  /* "src/graph.pyx":23
 * 
 *     def create_node(self):
 *         return self._handle.create_node().decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *     def remove_node(self, node_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->_handle->create_node(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":22
 *         )
 * 
 *     def create_node(self):             # <<<<<<<<<<<<<<
 *         return self._handle.create_node().decode('ascii')
 * 
 */

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

/* "src/graph.pyx":25
 *         return self._handle.create_node().decode('ascii')
 * 
 *     def remove_node(self, node_id):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_node(node_id.encode('ascii'))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_9remove_node(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_9remove_node(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_node (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_8remove_node(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_node_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_8remove_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("remove_node", 0);

  /* "src/graph.pyx":26
 * 
 *     def remove_node(self, node_id):
 *         return self._handle.remove_node(node_id.encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *     def update_node(self, node_id, props):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->remove_node(__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":25
 *         return self._handle.create_node().decode('ascii')
 * 
 *     def remove_node(self, node_id):             # <<<<<<<<<<<<<<
 *         return self._handle.remove_node(node_id.encode('ascii'))
 * 
 */

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

/* "src/graph.pyx":28
 *         return self._handle.remove_node(node_id.encode('ascii'))
 * 
 *     def update_node(self, node_id, props):             # <<<<<<<<<<<<<<
 *         cdef prop_t p
 *         props_py2native(props, p)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_11update_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_11update_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_node (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_props,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_props)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update_node", 1, 2, 2, 1); __PYX_ERR(12, 28, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_node") < 0)) __PYX_ERR(12, 28, __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_node_id = values[0];
    __pyx_v_props = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update_node", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 28, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.update_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_10update_node(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_props);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_10update_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_props) {
  __pyx_t_8_wrapper_prop_t __pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  __Pyx_RefNannySetupContext("update_node", 0);

  /* "src/graph.pyx":30
 *     def update_node(self, node_id, props):
 *         cdef prop_t p
 *         props_py2native(props, p)             # <<<<<<<<<<<<<<
 *         return self._handle.update_node(node_id.encode('ascii'), p)
 * 
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_props_py2native(__pyx_v_props, __pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":31
 *         cdef prop_t p
 *         props_py2native(props, p)
 *         return self._handle.update_node(node_id.encode('ascii'), p)             # <<<<<<<<<<<<<<
 * 
 *     def create_edge(self, node_id, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->update_node(__pyx_t_3, __pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":28
 *         return self._handle.remove_node(node_id.encode('ascii'))
 * 
 *     def update_node(self, node_id, props):             # <<<<<<<<<<<<<<
 *         cdef prop_t p
 *         props_py2native(props, p)
 */

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

/* "src/graph.pyx":33
 *         return self._handle.update_node(node_id.encode('ascii'), p)
 * 
 *     def create_edge(self, node_id, e):             # <<<<<<<<<<<<<<
 *         if not isinstance(e, Edge):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_13create_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_13create_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_e = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_edge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_e,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_edge", 1, 2, 2, 1); __PYX_ERR(12, 33, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_edge") < 0)) __PYX_ERR(12, 33, __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_node_id = values[0];
    __pyx_v_e = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_edge", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 33, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.create_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_12create_edge(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_e);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_12create_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_e) {
  __pyx_t_8_wrapper_prop_t __pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("create_edge", 0);

  /* "src/graph.pyx":34
 * 
 *     def create_edge(self, node_id, e):
 *         if not isinstance(e, Edge):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if node_id != e.source:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":35
 *     def create_edge(self, node_id, e):
 *         if not isinstance(e, Edge):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         if node_id != e.source:
 *             raise ValueError
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 35, __pyx_L1_error)

    /* "src/graph.pyx":34
 * 
 *     def create_edge(self, node_id, e):
 *         if not isinstance(e, Edge):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if node_id != e.source:
 */
  }

  /* "src/graph.pyx":36
 *         if not isinstance(e, Edge):
 *             raise ValueError
 *         if node_id != e.source:             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef prop_t p
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_node_id, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "src/graph.pyx":37
 *             raise ValueError
 *         if node_id != e.source:
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 37, __pyx_L1_error)

    /* "src/graph.pyx":36
 *         if not isinstance(e, Edge):
 *             raise ValueError
 *         if node_id != e.source:             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef prop_t p
 */
  }

  /* "src/graph.pyx":39
 *             raise ValueError
 *         cdef prop_t p
 *         props_py2native(e.property, p)             # <<<<<<<<<<<<<<
 *         return self._handle.create_edge(node_id.encode('ascii'),
 *                                         e.target.encode('ascii'), p)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_f_16embedded_jubatus_props_py2native(__pyx_t_4, __pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":40
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 *         return self._handle.create_edge(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                         e.target.encode('ascii'), p)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":41
 *         props_py2native(e.property, p)
 *         return self._handle.create_edge(node_id.encode('ascii'),
 *                                         e.target.encode('ascii'), p)             # <<<<<<<<<<<<<<
 * 
 *     def update_edge(self, node_id, edge_id, e):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":40
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 *         return self._handle.create_edge(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                         e.target.encode('ascii'), p)
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_handle->create_edge(__pyx_t_5, __pyx_t_6, __pyx_v_p)); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":33
 *         return self._handle.update_node(node_id.encode('ascii'), p)
 * 
 *     def create_edge(self, node_id, e):             # <<<<<<<<<<<<<<
 *         if not isinstance(e, Edge):
 *             raise ValueError
 */

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

/* "src/graph.pyx":43
 *                                         e.target.encode('ascii'), p)
 * 
 *     def update_edge(self, node_id, edge_id, e):             # <<<<<<<<<<<<<<
 *         if not isinstance(e, Edge):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_15update_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_15update_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_edge_id = 0;
  PyObject *__pyx_v_e = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_edge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_edge_id,&__pyx_n_s_e,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edge_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update_edge", 1, 3, 3, 1); __PYX_ERR(12, 43, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update_edge", 1, 3, 3, 2); __PYX_ERR(12, 43, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_edge") < 0)) __PYX_ERR(12, 43, __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_node_id = values[0];
    __pyx_v_edge_id = values[1];
    __pyx_v_e = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update_edge", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 43, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.update_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_14update_edge(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_edge_id, __pyx_v_e);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_14update_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id, PyObject *__pyx_v_e) {
  __pyx_t_8_wrapper_prop_t __pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_8_wrapper_edge_id_t __pyx_t_5;
  __Pyx_RefNannySetupContext("update_edge", 0);

  /* "src/graph.pyx":44
 * 
 *     def update_edge(self, node_id, edge_id, e):
 *         if not isinstance(e, Edge):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if node_id != e.source:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":45
 *     def update_edge(self, node_id, edge_id, e):
 *         if not isinstance(e, Edge):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         if node_id != e.source:
 *             raise ValueError
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 45, __pyx_L1_error)

    /* "src/graph.pyx":44
 * 
 *     def update_edge(self, node_id, edge_id, e):
 *         if not isinstance(e, Edge):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         if node_id != e.source:
 */
  }

  /* "src/graph.pyx":46
 *         if not isinstance(e, Edge):
 *             raise ValueError
 *         if node_id != e.source:             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef prop_t p
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_node_id, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "src/graph.pyx":47
 *             raise ValueError
 *         if node_id != e.source:
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 47, __pyx_L1_error)

    /* "src/graph.pyx":46
 *         if not isinstance(e, Edge):
 *             raise ValueError
 *         if node_id != e.source:             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef prop_t p
 */
  }

  /* "src/graph.pyx":49
 *             raise ValueError
 *         cdef prop_t p
 *         props_py2native(e.property, p)             # <<<<<<<<<<<<<<
 *         return self._handle.update_edge(edge_id, p)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_f_16embedded_jubatus_props_py2native(__pyx_t_4, __pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":50
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 *         return self._handle.update_edge(edge_id, p)             # <<<<<<<<<<<<<<
 * 
 *     def remove_edge(self, node_id, edge_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_v_edge_id); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 50, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_handle->update_edge(__pyx_t_5, __pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":43
 *                                         e.target.encode('ascii'), p)
 * 
 *     def update_edge(self, node_id, edge_id, e):             # <<<<<<<<<<<<<<
 *         if not isinstance(e, Edge):
 *             raise ValueError
 */

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

/* "src/graph.pyx":52
 *         return self._handle.update_edge(edge_id, p)
 * 
 *     def remove_edge(self, node_id, edge_id):             # <<<<<<<<<<<<<<
 *         self._handle.remove_edge(edge_id)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_17remove_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_17remove_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_edge_id = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_edge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_edge_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edge_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("remove_edge", 1, 2, 2, 1); __PYX_ERR(12, 52, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_edge") < 0)) __PYX_ERR(12, 52, __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_node_id = values[0];
    __pyx_v_edge_id = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_edge", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 52, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.remove_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_16remove_edge(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_edge_id);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_16remove_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_8_wrapper_edge_id_t __pyx_t_1;
  __Pyx_RefNannySetupContext("remove_edge", 0);

  /* "src/graph.pyx":53
 * 
 *     def remove_edge(self, node_id, edge_id):
 *         self._handle.remove_edge(edge_id)             # <<<<<<<<<<<<<<
 * 
 *     def get_centrality(self, node_id, centrality_type, query):
 */
  __pyx_t_1 = __Pyx_PyInt_As_uint64_t(__pyx_v_edge_id); if (unlikely((__pyx_t_1 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 53, __pyx_L1_error)
  __pyx_v_self->_handle->remove_edge(__pyx_t_1);

  /* "src/graph.pyx":52
 *         return self._handle.update_edge(edge_id, p)
 * 
 *     def remove_edge(self, node_id, edge_id):             # <<<<<<<<<<<<<<
 *         self._handle.remove_edge(edge_id)
 * 
 */

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

/* "src/graph.pyx":55
 *         self._handle.remove_edge(edge_id)
 * 
 *     def get_centrality(self, node_id, centrality_type, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_19get_centrality(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_19get_centrality(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_centrality_type = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_centrality (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_centrality_type,&__pyx_n_s_query,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_centrality_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_centrality", 1, 3, 3, 1); __PYX_ERR(12, 55, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_centrality", 1, 3, 3, 2); __PYX_ERR(12, 55, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_centrality") < 0)) __PYX_ERR(12, 55, __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_node_id = values[0];
    __pyx_v_centrality_type = values[1];
    __pyx_v_query = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_centrality", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 55, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.get_centrality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_18get_centrality(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_centrality_type, __pyx_v_query);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_18get_centrality(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id, PyObject *__pyx_v_centrality_type, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("get_centrality", 0);

  /* "src/graph.pyx":56
 * 
 *     def get_centrality(self, node_id, centrality_type, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":57
 *     def get_centrality(self, node_id, centrality_type, query):
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 57, __pyx_L1_error)

    /* "src/graph.pyx":56
 * 
 *     def get_centrality(self, node_id, centrality_type, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":59
 *             raise ValueError
 *         cdef preset_query q
 *         preset_query_py2native(query, q)             # <<<<<<<<<<<<<<
 *         return self._handle.get_centrality(node_id.encode('ascii'),
 *                                            centrality_type, q)
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_v_query, __pyx_v_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":60
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         return self._handle.get_centrality(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            centrality_type, q)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":61
 *         preset_query_py2native(query, q)
 *         return self._handle.get_centrality(node_id.encode('ascii'),
 *                                            centrality_type, q)             # <<<<<<<<<<<<<<
 * 
 *     def add_centrality_query(self, query):
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_centrality_type); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 61, __pyx_L1_error)

  /* "src/graph.pyx":60
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         return self._handle.get_centrality(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            centrality_type, q)
 * 
 */
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->_handle->get_centrality(__pyx_t_5, __pyx_t_6, __pyx_v_q)); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":55
 *         self._handle.remove_edge(edge_id)
 * 
 *     def get_centrality(self, node_id, centrality_type, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":63
 *                                            centrality_type, q)
 * 
 *     def add_centrality_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_21add_centrality_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_21add_centrality_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_centrality_query (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_20add_centrality_query(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_20add_centrality_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("add_centrality_query", 0);

  /* "src/graph.pyx":64
 * 
 *     def add_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":65
 *     def add_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 65, __pyx_L1_error)

    /* "src/graph.pyx":64
 * 
 *     def add_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":67
 *             raise ValueError
 *         cdef preset_query q
 *         preset_query_py2native(query, q)             # <<<<<<<<<<<<<<
 *         self._handle.add_centrality_query(q)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_v_query, __pyx_v_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":68
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         self._handle.add_centrality_query(q)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->add_centrality_query(__pyx_v_q);

  /* "src/graph.pyx":69
 *         preset_query_py2native(query, q)
 *         self._handle.add_centrality_query(q)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def add_shortest_path_query(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/graph.pyx":63
 *                                            centrality_type, q)
 * 
 *     def add_centrality_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":71
 *         return True
 * 
 *     def add_shortest_path_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_23add_shortest_path_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_23add_shortest_path_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_shortest_path_query (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_22add_shortest_path_query(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_22add_shortest_path_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("add_shortest_path_query", 0);

  /* "src/graph.pyx":72
 * 
 *     def add_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":73
 *     def add_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 73, __pyx_L1_error)

    /* "src/graph.pyx":72
 * 
 *     def add_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":75
 *             raise ValueError
 *         cdef preset_query q
 *         preset_query_py2native(query, q)             # <<<<<<<<<<<<<<
 *         self._handle.add_shortest_path_query(q)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_v_query, __pyx_v_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":76
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         self._handle.add_shortest_path_query(q)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->add_shortest_path_query(__pyx_v_q);

  /* "src/graph.pyx":77
 *         preset_query_py2native(query, q)
 *         self._handle.add_shortest_path_query(q)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def remove_centrality_query(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/graph.pyx":71
 *         return True
 * 
 *     def add_shortest_path_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":79
 *         return True
 * 
 *     def remove_centrality_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_25remove_centrality_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_25remove_centrality_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_centrality_query (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_24remove_centrality_query(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_24remove_centrality_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("remove_centrality_query", 0);

  /* "src/graph.pyx":80
 * 
 *     def remove_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":81
 *     def remove_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 81, __pyx_L1_error)

    /* "src/graph.pyx":80
 * 
 *     def remove_centrality_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":83
 *             raise ValueError
 *         cdef preset_query q
 *         preset_query_py2native(query, q)             # <<<<<<<<<<<<<<
 *         self._handle.remove_centrality_query(q)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_v_query, __pyx_v_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":84
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         self._handle.remove_centrality_query(q)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->remove_centrality_query(__pyx_v_q);

  /* "src/graph.pyx":85
 *         preset_query_py2native(query, q)
 *         self._handle.remove_centrality_query(q)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def remove_shortest_path_query(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/graph.pyx":79
 *         return True
 * 
 *     def remove_centrality_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":87
 *         return True
 * 
 *     def remove_shortest_path_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_27remove_shortest_path_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_27remove_shortest_path_query(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_shortest_path_query (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_26remove_shortest_path_query(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_26remove_shortest_path_query(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("remove_shortest_path_query", 0);

  /* "src/graph.pyx":88
 * 
 *     def remove_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":89
 *     def remove_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 89, __pyx_L1_error)

    /* "src/graph.pyx":88
 * 
 *     def remove_shortest_path_query(self, query):
 *         if not isinstance(query, PresetQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":91
 *             raise ValueError
 *         cdef preset_query q
 *         preset_query_py2native(query, q)             # <<<<<<<<<<<<<<
 *         self._handle.remove_shortest_path_query(q)
 *         return True
 */
  __pyx_t_1 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_v_query, __pyx_v_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/graph.pyx":92
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         self._handle.remove_shortest_path_query(q)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->remove_shortest_path_query(__pyx_v_q);

  /* "src/graph.pyx":93
 *         preset_query_py2native(query, q)
 *         self._handle.remove_shortest_path_query(q)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def get_shortest_path(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/graph.pyx":87
 *         return True
 * 
 *     def remove_shortest_path_query(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, PresetQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":95
 *         return True
 * 
 *     def get_shortest_path(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, ShortestPathQuery):
 *             raise ValueError
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_29get_shortest_path(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_29get_shortest_path(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_shortest_path (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_28get_shortest_path(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_28get_shortest_path(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_query) {
  jubatus::core::graph::preset_query __pyx_v_q;
  std::vector<__pyx_t_8_wrapper_node_id_t>  __pyx_v_r;
  __pyx_t_8_wrapper_node_id_t __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  uint64_t __pyx_t_7;
  std::vector<__pyx_t_8_wrapper_node_id_t> ::iterator __pyx_t_8;
  __pyx_t_8_wrapper_node_id_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("get_shortest_path", 0);

  /* "src/graph.pyx":96
 * 
 *     def get_shortest_path(self, query):
 *         if not isinstance(query, ShortestPathQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ShortestPathQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_query, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "src/graph.pyx":97
 *     def get_shortest_path(self, query):
 *         if not isinstance(query, ShortestPathQuery):
 *             raise ValueError             # <<<<<<<<<<<<<<
 *         cdef preset_query q
 *         cdef vector[node_id_t] r
 */
    __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
    __PYX_ERR(12, 97, __pyx_L1_error)

    /* "src/graph.pyx":96
 * 
 *     def get_shortest_path(self, query):
 *         if not isinstance(query, ShortestPathQuery):             # <<<<<<<<<<<<<<
 *             raise ValueError
 *         cdef preset_query q
 */
  }

  /* "src/graph.pyx":100
 *         cdef preset_query q
 *         cdef vector[node_id_t] r
 *         preset_query_py2native(query.query, q)             # <<<<<<<<<<<<<<
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),
 *                                            query.target.encode('ascii'),
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_f_16embedded_jubatus_preset_query_py2native(__pyx_t_1, __pyx_v_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":101
 *         cdef vector[node_id_t] r
 *         preset_query_py2native(query.query, q)
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            query.target.encode('ascii'),
 *                                            query.max_hop, q)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":102
 *         preset_query_py2native(query.query, q)
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),
 *                                            query.target.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            query.max_hop, q)
 *         return [str(x) for x in r]
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":103
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),
 *                                            query.target.encode('ascii'),
 *                                            query.max_hop, q)             # <<<<<<<<<<<<<<
 *         return [str(x) for x in r]
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_max_hop); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "src/graph.pyx":101
 *         cdef vector[node_id_t] r
 *         preset_query_py2native(query.query, q)
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            query.target.encode('ascii'),
 *                                            query.max_hop, q)
 */
  __pyx_v_r = __pyx_v_self->_handle->get_shortest_path(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_q);

  /* "src/graph.pyx":104
 *                                            query.target.encode('ascii'),
 *                                            query.max_hop, q)
 *         return [str(x) for x in r]             # <<<<<<<<<<<<<<
 * 
 *     def update_index(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __pyx_v_r.begin();
  for (;;) {
    if (!(__pyx_t_8 != __pyx_v_r.end())) break;
    __pyx_t_9 = *__pyx_t_8;
    ++__pyx_t_8;
    __pyx_v_x = __pyx_t_9;
    __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(12, 104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":95
 *         return True
 * 
 *     def get_shortest_path(self, query):             # <<<<<<<<<<<<<<
 *         if not isinstance(query, ShortestPathQuery):
 *             raise ValueError
 */

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

/* "src/graph.pyx":106
 *         return [str(x) for x in r]
 * 
 *     def update_index(self):             # <<<<<<<<<<<<<<
 *         self._handle.update_index()
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_31update_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_31update_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_index (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_30update_index(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_30update_index(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_index", 0);

  /* "src/graph.pyx":107
 * 
 *     def update_index(self):
 *         self._handle.update_index()             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_v_self->_handle->update_index();

  /* "src/graph.pyx":108
 *     def update_index(self):
 *         self._handle.update_index()
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def get_node(self, node_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "src/graph.pyx":106
 *         return [str(x) for x in r]
 * 
 *     def update_index(self):             # <<<<<<<<<<<<<<
 *         self._handle.update_index()
 *         return True
 */

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

/* "src/graph.pyx":110
 *         return True
 * 
 *     def get_node(self, node_id):             # <<<<<<<<<<<<<<
 *         cdef node_info n
 *         n = self._handle.get_node(node_id.encode('ascii'))
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_33get_node(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_33get_node(PyObject *__pyx_v_self, PyObject *__pyx_v_node_id) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_node (wrapper)", 0);
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_32get_node(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_node_id));

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_32get_node(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, PyObject *__pyx_v_node_id) {
  jubatus::core::graph::node_info __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("get_node", 0);

  /* "src/graph.pyx":112
 *     def get_node(self, node_id):
 *         cdef node_info n
 *         n = self._handle.get_node(node_id.encode('ascii'))             # <<<<<<<<<<<<<<
 *         return Node(props_native2py(n.property),
 *                     edges_native2py(n.in_edges),
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_v_self->_handle->get_node(__pyx_t_3);

  /* "src/graph.pyx":113
 *         cdef node_info n
 *         n = self._handle.get_node(node_id.encode('ascii'))
 *         return Node(props_native2py(n.property),             # <<<<<<<<<<<<<<
 *                     edges_native2py(n.in_edges),
 *                     edges_native2py(n.out_edges))
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_f_16embedded_jubatus_props_native2py(__pyx_v_n.property); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "src/graph.pyx":114
 *         n = self._handle.get_node(node_id.encode('ascii'))
 *         return Node(props_native2py(n.property),
 *                     edges_native2py(n.in_edges),             # <<<<<<<<<<<<<<
 *                     edges_native2py(n.out_edges))
 * 
 */
  __pyx_t_5 = __pyx_f_16embedded_jubatus_edges_native2py(__pyx_v_n.in_edges); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "src/graph.pyx":115
 *         return Node(props_native2py(n.property),
 *                     edges_native2py(n.in_edges),
 *                     edges_native2py(n.out_edges))             # <<<<<<<<<<<<<<
 * 
 *     def get_edge(self, node_id, edge_id):
 */
  __pyx_t_6 = __pyx_f_16embedded_jubatus_edges_native2py(__pyx_v_n.out_edges); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 113, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 113, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":110
 *         return True
 * 
 *     def get_node(self, node_id):             # <<<<<<<<<<<<<<
 *         cdef node_info n
 *         n = self._handle.get_node(node_id.encode('ascii'))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.get_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/graph.pyx":117
 *                     edges_native2py(n.out_edges))
 * 
 *     def get_edge(self, node_id, edge_id):             # <<<<<<<<<<<<<<
 *         cdef edge_info e
 *         e = self._handle.get_edge(edge_id)
 */

/* Python wrapper */
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_35get_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_16embedded_jubatus_13_GraphWrapper_35get_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_node_id = 0;
  PyObject *__pyx_v_edge_id = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_edge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_id,&__pyx_n_s_edge_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edge_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_edge", 1, 2, 2, 1); __PYX_ERR(12, 117, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge") < 0)) __PYX_ERR(12, 117, __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_node_id = values[0];
    __pyx_v_edge_id = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_edge", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 117, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.get_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_16embedded_jubatus_13_GraphWrapper_34get_edge(((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)__pyx_v_self), __pyx_v_node_id, __pyx_v_edge_id);

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

static PyObject *__pyx_pf_16embedded_jubatus_13_GraphWrapper_34get_edge(struct __pyx_obj_16embedded_jubatus__GraphWrapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_node_id, PyObject *__pyx_v_edge_id) {
  jubatus::core::graph::edge_info __pyx_v_e;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_8_wrapper_edge_id_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("get_edge", 0);

  /* "src/graph.pyx":119
 *     def get_edge(self, node_id, edge_id):
 *         cdef edge_info e
 *         e = self._handle.get_edge(edge_id)             # <<<<<<<<<<<<<<
 *         return Edge(props_native2py(e.p),
 *                     str(e.src), str(e.tgt))
 */
  __pyx_t_1 = __Pyx_PyInt_As_uint64_t(__pyx_v_edge_id); if (unlikely((__pyx_t_1 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 119, __pyx_L1_error)
  __pyx_v_e = __pyx_v_self->_handle->get_edge(__pyx_t_1);

  /* "src/graph.pyx":120
 *         cdef edge_info e
 *         e = self._handle.get_edge(edge_id)
 *         return Edge(props_native2py(e.p),             # <<<<<<<<<<<<<<
 *                     str(e.src), str(e.tgt))
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Edge); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_16embedded_jubatus_props_native2py(__pyx_v_e.p); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "src/graph.pyx":121
 *         e = self._handle.get_edge(edge_id)
 *         return Edge(props_native2py(e.p),
 *                     str(e.src), str(e.tgt))             # <<<<<<<<<<<<<<
 */
  __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_e.src); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_e.tgt); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 120, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 120, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/graph.pyx":117
 *                     edges_native2py(n.out_edges))
 * 
 *     def get_edge(self, node_id, edge_id):             # <<<<<<<<<<<<<<
 *         cdef edge_info e
 *         e = self._handle.get_edge(edge_id)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("embedded_jubatus._GraphWrapper.get_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(13, 218, __pyx_L1_error)

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(13, 222, __pyx_L1_error)

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L11;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*else*/ {
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_1) {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(13, 259, __pyx_L1_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = ((char *)"B");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      case NPY_SHORT:
      __pyx_v_f = ((char *)"h");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      case NPY_USHORT:
      __pyx_v_f = ((char *)"H");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      case NPY_INT:
      __pyx_v_f = ((char *)"i");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      case NPY_UINT:
      __pyx_v_f = ((char *)"I");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      case NPY_LONG:
      __pyx_v_f = ((char *)"l");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      case NPY_ULONG:
      __pyx_v_f = ((char *)"L");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      case NPY_LONGLONG:
      __pyx_v_f = ((char *)"q");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = ((char *)"Q");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      case NPY_FLOAT:
      __pyx_v_f = ((char *)"f");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = ((char *)"d");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = ((char *)"g");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = ((char *)"Zf");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = ((char *)"Zd");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = ((char *)"Zg");
      break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = ((char *)"O");
      break;
      default:

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(13, 278, __pyx_L1_error)
      break;
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(13, 285, __pyx_L1_error)
    __pyx_v_f = __pyx_t_7;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

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

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(13, 794, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 794, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(13, 795, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 795, __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(13, 795, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(13, 796, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(13, 796, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(13, 796, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 798, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 799, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(13, 799, __pyx_L1_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_6) {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(13, 803, __pyx_L1_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 823, __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(13, 823, __pyx_L1_error)

        /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 840, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 840, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(13, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 844, __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 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 844, __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(13, 844, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(13, 849, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

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

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
 * cdef inline int import_array() except -1:
 *     try:
 *         _import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(13, 987, __pyx_L3_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
 *     try:
 *         _import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(13, 988, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 989, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(13, 989, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":993
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(13, 993, __pyx_L3_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":994
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(13, 994, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 995, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(13, 995, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(13, 999, __pyx_L3_error)

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(13, 1000, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 1001, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(13, 1001, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __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 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 *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__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 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 == NULL)) __PYX_ERR(14, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length
 *     cdef 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 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_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyStr_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);

  /* "string.to_py":56
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

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

static PyObject *__pyx_tp_new_16embedded_jubatus__AnomalyWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__AnomalyWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_15_AnomalyWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__AnomalyWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_5_init, METH_O, 0},
  {"clear_row", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_7clear_row, METH_O, 0},
  {"add", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_9add, METH_O, 0},
  {"update", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_11update, METH_VARARGS|METH_KEYWORDS, 0},
  {"overwrite", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_13overwrite, METH_VARARGS|METH_KEYWORDS, 0},
  {"calc_score", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_15calc_score, METH_O, 0},
  {"get_all_rows", (PyCFunction)__pyx_pw_16embedded_jubatus_15_AnomalyWrapper_17get_all_rows, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__AnomalyWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._AnomalyWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__AnomalyWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__AnomalyWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__AnomalyWrapper, /*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_16embedded_jubatus__AnomalyWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__BanditWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_14_BanditWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__BanditWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_14_BanditWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__BanditWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_5_init, METH_O, 0},
  {"register_arm", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_7register_arm, METH_O, 0},
  {"delete_arm", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_9delete_arm, METH_O, 0},
  {"select_arm", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_11select_arm, METH_O, 0},
  {"register_reward", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_13register_reward, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_arm_info", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_15get_arm_info, METH_O, 0},
  {"reset", (PyCFunction)__pyx_pw_16embedded_jubatus_14_BanditWrapper_17reset, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__BanditWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._BanditWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__BanditWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__BanditWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__BanditWrapper, /*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_16embedded_jubatus__BanditWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__BurstWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_13_BurstWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__BurstWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_13_BurstWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__BurstWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_5_init, METH_O, 0},
  {"add_documents", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_7add_documents, METH_O, 0},
  {"get_result", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_9get_result, METH_O, 0},
  {"get_result_at", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_11get_result_at, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_all_bursted_results", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_13get_all_bursted_results, METH_NOARGS, 0},
  {"get_all_bursted_results_at", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_15get_all_bursted_results_at, METH_O, 0},
  {"get_all_keywords", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_17get_all_keywords, METH_NOARGS, 0},
  {"add_keyword", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_19add_keyword, METH_O, 0},
  {"remove_keyword", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_21remove_keyword, METH_O, 0},
  {"remove_all_keywords", (PyCFunction)__pyx_pw_16embedded_jubatus_13_BurstWrapper_23remove_all_keywords, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__BurstWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._BurstWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__BurstWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__BurstWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__BurstWrapper, /*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_16embedded_jubatus__BurstWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__ClassifierWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__ClassifierWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_18_ClassifierWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__ClassifierWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_5_init, METH_O, 0},
  {"train", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_7train, METH_O, 0},
  {"classify", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_9classify, METH_O, 0},
  {"get_labels", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_11get_labels, METH_NOARGS, 0},
  {"set_label", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_13set_label, METH_O, 0},
  {"delete_label", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_15delete_label, METH_O, 0},
  {"fit", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_17fit, METH_VARARGS|METH_KEYWORDS, 0},
  {"partial_fit", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_19partial_fit, METH_VARARGS|METH_KEYWORDS, 0},
  {"decision_function", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_21decision_function, METH_O, 0},
  {"predict", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClassifierWrapper_23predict, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__ClassifierWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._ClassifierWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__ClassifierWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__ClassifierWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__ClassifierWrapper, /*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_16embedded_jubatus__ClassifierWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__ClusteringWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__ClusteringWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_18_ClusteringWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__ClusteringWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_5_init, METH_O, 0},
  {"push", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_7push, METH_O, 0},
  {"get_revision", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_9get_revision, METH_NOARGS, 0},
  {"get_core_members", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_11get_core_members, METH_NOARGS, 0},
  {"get_k_center", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_13get_k_center, METH_NOARGS, 0},
  {"get_nearest_center", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_15get_nearest_center, METH_O, 0},
  {"get_nearest_members", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_17get_nearest_members, METH_O, 0},
  {"get_core_members_light", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_19get_core_members_light, METH_NOARGS, 0},
  {"get_nearest_members_light", (PyCFunction)__pyx_pw_16embedded_jubatus_18_ClusteringWrapper_21get_nearest_members_light, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__ClusteringWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._ClusteringWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__ClusteringWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__ClusteringWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__ClusteringWrapper, /*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_16embedded_jubatus__ClusteringWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__NearestNeighborWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__NearestNeighborWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_23_NearestNeighborWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__NearestNeighborWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_5_init, METH_O, 0},
  {"set_row", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_7set_row, METH_VARARGS|METH_KEYWORDS, 0},
  {"neighbor_row_from_id", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_9neighbor_row_from_id, METH_VARARGS|METH_KEYWORDS, 0},
  {"neighbor_row_from_datum", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_11neighbor_row_from_datum, METH_VARARGS|METH_KEYWORDS, 0},
  {"similar_row_from_id", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_13similar_row_from_id, METH_VARARGS|METH_KEYWORDS, 0},
  {"similar_row_from_datum", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_15similar_row_from_datum, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_all_rows", (PyCFunction)__pyx_pw_16embedded_jubatus_23_NearestNeighborWrapper_17get_all_rows, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__NearestNeighborWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._NearestNeighborWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__NearestNeighborWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__NearestNeighborWrapper, /*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_16embedded_jubatus__NearestNeighborWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__RecommenderWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__RecommenderWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_19_RecommenderWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__RecommenderWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_5_init, METH_O, 0},
  {"clear_row", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_7clear_row, METH_O, 0},
  {"update_row", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_9update_row, METH_VARARGS|METH_KEYWORDS, 0},
  {"complete_row_from_id", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_11complete_row_from_id, METH_O, 0},
  {"complete_row_from_datum", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_13complete_row_from_datum, METH_O, 0},
  {"similar_row_from_id", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_15similar_row_from_id, METH_VARARGS|METH_KEYWORDS, 0},
  {"similar_row_from_datum", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_17similar_row_from_datum, METH_VARARGS|METH_KEYWORDS, 0},
  {"decode_row", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_19decode_row, METH_O, 0},
  {"get_all_rows", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_21get_all_rows, METH_NOARGS, 0},
  {"calc_similarity", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_23calc_similarity, METH_VARARGS|METH_KEYWORDS, 0},
  {"calc_l2norm", (PyCFunction)__pyx_pw_16embedded_jubatus_19_RecommenderWrapper_25calc_l2norm, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__RecommenderWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._RecommenderWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__RecommenderWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__RecommenderWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__RecommenderWrapper, /*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_16embedded_jubatus__RecommenderWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__RegressionWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_18_RegressionWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__RegressionWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_18_RegressionWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__RegressionWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_5_init, METH_O, 0},
  {"train", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_7train, METH_O, 0},
  {"estimate", (PyCFunction)__pyx_pw_16embedded_jubatus_18_RegressionWrapper_9estimate, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__RegressionWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._RegressionWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__RegressionWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__RegressionWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__RegressionWrapper, /*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_16embedded_jubatus__RegressionWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__StatWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_12_StatWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__StatWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_12_StatWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__StatWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_5_init, METH_O, 0},
  {"push", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_7push, METH_VARARGS|METH_KEYWORDS, 0},
  {"sum", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_9sum, METH_O, 0},
  {"stddev", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_11stddev, METH_O, 0},
  {"max", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_13max, METH_O, 0},
  {"min", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_15min, METH_O, 0},
  {"entropy", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_17entropy, METH_O, 0},
  {"moment", (PyCFunction)__pyx_pw_16embedded_jubatus_12_StatWrapper_19moment, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__StatWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._StatWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__StatWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__StatWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__StatWrapper, /*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_16embedded_jubatus__StatWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__WeightWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_14_WeightWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__WeightWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_14_WeightWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__WeightWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_5_init, METH_O, 0},
  {"update", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_7update, METH_O, 0},
  {"calc_weight", (PyCFunction)__pyx_pw_16embedded_jubatus_14_WeightWrapper_9calc_weight, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__WeightWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._WeightWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__WeightWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__WeightWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__WeightWrapper, /*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_16embedded_jubatus__WeightWrapper, /*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 PyObject *__pyx_tp_new_16embedded_jubatus__GraphWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  if (unlikely(__pyx_pw_16embedded_jubatus_13_GraphWrapper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_16embedded_jubatus__GraphWrapper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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_16embedded_jubatus_13_GraphWrapper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_16embedded_jubatus__GraphWrapper[] = {
  {"_init", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_5_init, METH_O, 0},
  {"create_node", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_7create_node, METH_NOARGS, 0},
  {"remove_node", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_9remove_node, METH_O, 0},
  {"update_node", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_11update_node, METH_VARARGS|METH_KEYWORDS, 0},
  {"create_edge", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_13create_edge, METH_VARARGS|METH_KEYWORDS, 0},
  {"update_edge", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_15update_edge, METH_VARARGS|METH_KEYWORDS, 0},
  {"remove_edge", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_17remove_edge, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_centrality", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_19get_centrality, METH_VARARGS|METH_KEYWORDS, 0},
  {"add_centrality_query", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_21add_centrality_query, METH_O, 0},
  {"add_shortest_path_query", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_23add_shortest_path_query, METH_O, 0},
  {"remove_centrality_query", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_25remove_centrality_query, METH_O, 0},
  {"remove_shortest_path_query", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_27remove_shortest_path_query, METH_O, 0},
  {"get_shortest_path", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_29get_shortest_path, METH_O, 0},
  {"update_index", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_31update_index, METH_NOARGS, 0},
  {"get_node", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_33get_node, METH_O, 0},
  {"get_edge", (PyCFunction)__pyx_pw_16embedded_jubatus_13_GraphWrapper_35get_edge, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_16embedded_jubatus__GraphWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus._GraphWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus__GraphWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus__GraphWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_16embedded_jubatus__GraphWrapper, /*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_16embedded_jubatus__GraphWrapper, /*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_16embedded_jubatus___pyx_scope_struct___init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct___init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct___init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct___init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct___init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct___init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct___init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct___init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct___init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct___init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct___init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct___init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct___init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__AnomalyWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct___init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct___init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct___init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct___init, /*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_16embedded_jubatus___pyx_scope_struct___init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct___init, /*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_16embedded_jubatus___pyx_scope_struct___init, /*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_16embedded_jubatus___pyx_scope_struct_1__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_1__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_1__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_1__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_1__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_1__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_1__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_1__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_1__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_1__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_1__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_1__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_1__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__BanditWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_1__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_1__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_1__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_1__init, /*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_16embedded_jubatus___pyx_scope_struct_1__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_1__init, /*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_16embedded_jubatus___pyx_scope_struct_1__init, /*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_16embedded_jubatus___pyx_scope_struct_2__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_2__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_2__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_2__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_2__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_2__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_2__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_2__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_2__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_2__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_2__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_2__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_2__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__BurstWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_2__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_2__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_2__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_2__init, /*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_16embedded_jubatus___pyx_scope_struct_2__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_2__init, /*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_16embedded_jubatus___pyx_scope_struct_2__init, /*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_16embedded_jubatus___pyx_scope_struct_3__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_3__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_3__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_3__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_3__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_3__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_3__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_3__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_3__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_3__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_3__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_3__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_3__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__ClassifierWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_3__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_3__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_3__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_3__init, /*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_16embedded_jubatus___pyx_scope_struct_3__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_3__init, /*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_16embedded_jubatus___pyx_scope_struct_3__init, /*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_16embedded_jubatus___pyx_scope_struct_4__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_4__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_4__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_4__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_4__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_4__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_4__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_4__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_4__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_4__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_4__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_4__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_4__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__ClusteringWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_4__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_4__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_4__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_4__init, /*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_16embedded_jubatus___pyx_scope_struct_4__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_4__init, /*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_16embedded_jubatus___pyx_scope_struct_4__init, /*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_16embedded_jubatus___pyx_scope_struct_5__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_5__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_5__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_5__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_5__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_5__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_5__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_5__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_5__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_5__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_5__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_5__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_5__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__NearestNeighborWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_5__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_5__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_5__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_5__init, /*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_16embedded_jubatus___pyx_scope_struct_5__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_5__init, /*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_16embedded_jubatus___pyx_scope_struct_5__init, /*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_16embedded_jubatus___pyx_scope_struct_6__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_6__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_6__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_6__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_6__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_6__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_6__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_6__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_6__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_6__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_6__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_6__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_6__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__RecommenderWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_6__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_6__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_6__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_6__init, /*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_16embedded_jubatus___pyx_scope_struct_6__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_6__init, /*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_16embedded_jubatus___pyx_scope_struct_6__init, /*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_16embedded_jubatus___pyx_scope_struct_7__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_7__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_7__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_7__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_7__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_7__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_7__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_7__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_7__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_7__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_7__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_7__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_7__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__RegressionWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_7__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_7__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_7__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_7__init, /*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_16embedded_jubatus___pyx_scope_struct_7__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_7__init, /*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_16embedded_jubatus___pyx_scope_struct_7__init, /*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_16embedded_jubatus___pyx_scope_struct_8__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_8__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_8__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_8__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_8__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_8__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_8__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_8__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_8__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_8__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_8__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_8__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_8__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__StatWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_8__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_8__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_8__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_8__init, /*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_16embedded_jubatus___pyx_scope_struct_8__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_8__init, /*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_16embedded_jubatus___pyx_scope_struct_8__init, /*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_16embedded_jubatus___pyx_scope_struct_9__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_9__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_9__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_9__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_9__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_9__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_9__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_9__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_9__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_9__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_9__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_9__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_9__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__WeightWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_9__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_9__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_9__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_9__init, /*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_16embedded_jubatus___pyx_scope_struct_9__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_9__init, /*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_16embedded_jubatus___pyx_scope_struct_9__init, /*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_16embedded_jubatus___pyx_scope_struct_10__init *__pyx_freelist_16embedded_jubatus___pyx_scope_struct_10__init[8];
static int __pyx_freecount_16embedded_jubatus___pyx_scope_struct_10__init = 0;

static PyObject *__pyx_tp_new_16embedded_jubatus___pyx_scope_struct_10__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_10__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init)))) {
    o = (PyObject*)__pyx_freelist_16embedded_jubatus___pyx_scope_struct_10__init[--__pyx_freecount_16embedded_jubatus___pyx_scope_struct_10__init];
    memset(o, 0, sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_10__init(PyObject *o) {
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_typ);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_16embedded_jubatus___pyx_scope_struct_10__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init)))) {
    __pyx_freelist_16embedded_jubatus___pyx_scope_struct_10__init[__pyx_freecount_16embedded_jubatus___pyx_scope_struct_10__init++] = ((struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_16embedded_jubatus___pyx_scope_struct_10__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_10__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *p = (struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_16embedded_jubatus__GraphWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_16embedded_jubatus___pyx_scope_struct_10__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "embedded_jubatus.__pyx_scope_struct_10__init", /*tp_name*/
  sizeof(struct __pyx_obj_16embedded_jubatus___pyx_scope_struct_10__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_16embedded_jubatus___pyx_scope_struct_10__init, /*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_16embedded_jubatus___pyx_scope_struct_10__init, /*tp_traverse*/
  __pyx_tp_clear_16embedded_jubatus___pyx_scope_struct_10__init, /*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_16embedded_jubatus___pyx_scope_struct_10__init, /*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
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "embedded_jubatus",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_127_0_0_1, __pyx_k_127_0_0_1, sizeof(__pyx_k_127_0_0_1), 0, 0, 1, 0},
  {&__pyx_n_s_Anomaly, __pyx_k_Anomaly, sizeof(__pyx_k_Anomaly), 0, 0, 1, 1},
  {&__pyx_n_s_AnomalyIdWithScore, __pyx_k_AnomalyIdWithScore, sizeof(__pyx_k_AnomalyIdWithScore), 0, 0, 1, 1},
  {&__pyx_n_s_ArmInfo, __pyx_k_ArmInfo, sizeof(__pyx_k_ArmInfo), 0, 0, 1, 1},
  {&__pyx_n_s_Bandit, __pyx_k_Bandit, sizeof(__pyx_k_Bandit), 0, 0, 1, 1},
  {&__pyx_n_s_Batch, __pyx_k_Batch, sizeof(__pyx_k_Batch), 0, 0, 1, 1},
  {&__pyx_n_s_Burst, __pyx_k_Burst, sizeof(__pyx_k_Burst), 0, 0, 1, 1},
  {&__pyx_n_s_Classifier, __pyx_k_Classifier, sizeof(__pyx_k_Classifier), 0, 0, 1, 1},
  {&__pyx_n_s_Clustering, __pyx_k_Clustering, sizeof(__pyx_k_Clustering), 0, 0, 1, 1},
  {&__pyx_n_s_Datum, __pyx_k_Datum, sizeof(__pyx_k_Datum), 0, 0, 1, 1},
  {&__pyx_n_s_Document, __pyx_k_Document, sizeof(__pyx_k_Document), 0, 0, 1, 1},
  {&__pyx_n_s_Edge, __pyx_k_Edge, sizeof(__pyx_k_Edge), 0, 0, 1, 1},
  {&__pyx_n_s_EstimateResult, __pyx_k_EstimateResult, sizeof(__pyx_k_EstimateResult), 0, 0, 1, 1},
  {&__pyx_n_s_Feature, __pyx_k_Feature, sizeof(__pyx_k_Feature), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  {&__pyx_n_s_IdWithScore, __pyx_k_IdWithScore, sizeof(__pyx_k_IdWithScore), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase, __pyx_k_JubatusBase, sizeof(__pyx_k_JubatusBase), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase___getstate, __pyx_k_JubatusBase___getstate, sizeof(__pyx_k_JubatusBase___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase___init, __pyx_k_JubatusBase___init, sizeof(__pyx_k_JubatusBase___init), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase___setstate, __pyx_k_JubatusBase___setstate, sizeof(__pyx_k_JubatusBase___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase__get_model_path, __pyx_k_JubatusBase__get_model_path, sizeof(__pyx_k_JubatusBase__get_model_path), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_clear, __pyx_k_JubatusBase_clear, sizeof(__pyx_k_JubatusBase_clear), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_do_mix, __pyx_k_JubatusBase_do_mix, sizeof(__pyx_k_JubatusBase_do_mix), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_get_client, __pyx_k_JubatusBase_get_client, sizeof(__pyx_k_JubatusBase_get_client), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_get_name, __pyx_k_JubatusBase_get_name, sizeof(__pyx_k_JubatusBase_get_name), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_get_proxy_status, __pyx_k_JubatusBase_get_proxy_status, sizeof(__pyx_k_JubatusBase_get_proxy_status), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_get_status, __pyx_k_JubatusBase_get_status, sizeof(__pyx_k_JubatusBase_get_status), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_load, __pyx_k_JubatusBase_load, sizeof(__pyx_k_JubatusBase_load), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_save, __pyx_k_JubatusBase_save, sizeof(__pyx_k_JubatusBase_save), 0, 0, 1, 1},
  {&__pyx_n_s_JubatusBase_set_name, __pyx_k_JubatusBase_set_name, sizeof(__pyx_k_JubatusBase_set_name), 0, 0, 1, 1},
  {&__pyx_n_s_KeywordWithParams, __pyx_k_KeywordWithParams, sizeof(__pyx_k_KeywordWithParams), 0, 0, 1, 1},
  {&__pyx_n_s_LabeledDatum, __pyx_k_LabeledDatum, sizeof(__pyx_k_LabeledDatum), 0, 0, 1, 1},
  {&__pyx_n_s_NNIdWithScore, __pyx_k_NNIdWithScore, sizeof(__pyx_k_NNIdWithScore), 0, 0, 1, 1},
  {&__pyx_n_s_NearestNeighbor, __pyx_k_NearestNeighbor, sizeof(__pyx_k_NearestNeighbor), 0, 0, 1, 1},
  {&__pyx_n_s_Node, __pyx_k_Node, sizeof(__pyx_k_Node), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_PresetQuery, __pyx_k_PresetQuery, sizeof(__pyx_k_PresetQuery), 0, 0, 1, 1},
  {&__pyx_n_s_Query, __pyx_k_Query, sizeof(__pyx_k_Query), 0, 0, 1, 1},
  {&__pyx_n_s_Recommender, __pyx_k_Recommender, sizeof(__pyx_k_Recommender), 0, 0, 1, 1},
  {&__pyx_n_s_RecommenderIdWithScore, __pyx_k_RecommenderIdWithScore, sizeof(__pyx_k_RecommenderIdWithScore), 0, 0, 1, 1},
  {&__pyx_n_s_Regression, __pyx_k_Regression, sizeof(__pyx_k_Regression), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_ScoredDatum, __pyx_k_ScoredDatum, sizeof(__pyx_k_ScoredDatum), 0, 0, 1, 1},
  {&__pyx_n_s_ShortestPathQuery, __pyx_k_ShortestPathQuery, sizeof(__pyx_k_ShortestPathQuery), 0, 0, 1, 1},
  {&__pyx_n_s_Stat, __pyx_k_Stat, sizeof(__pyx_k_Stat), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 0, 1, 1},
  {&__pyx_n_s_WeightedDatum, __pyx_k_WeightedDatum, sizeof(__pyx_k_WeightedDatum), 0, 0, 1, 1},
  {&__pyx_n_s_WeightedIndex, __pyx_k_WeightedIndex, sizeof(__pyx_k_WeightedIndex), 0, 0, 1, 1},
  {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1},
  {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1},
  {&__pyx_n_s_add_binary, __pyx_k_add_binary, sizeof(__pyx_k_add_binary), 0, 0, 1, 1},
  {&__pyx_n_s_add_number, __pyx_k_add_number, sizeof(__pyx_k_add_number), 0, 0, 1, 1},
  {&__pyx_n_s_add_string, __pyx_k_add_string, sizeof(__pyx_k_add_string), 0, 0, 1, 1},
  {&__pyx_n_b_anomaly, __pyx_k_anomaly, sizeof(__pyx_k_anomaly), 0, 0, 0, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arm_id, __pyx_k_arm_id, sizeof(__pyx_k_arm_id), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_b_bandit, __pyx_k_bandit, sizeof(__pyx_k_bandit), 0, 0, 0, 1},
  {&__pyx_n_s_binary_values, __pyx_k_binary_values, sizeof(__pyx_k_binary_values), 0, 0, 1, 1},
  {&__pyx_n_b_burst, __pyx_k_burst, sizeof(__pyx_k_burst), 0, 0, 0, 1},
  {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
  {&__pyx_n_s_centrality_type, __pyx_k_centrality_type, sizeof(__pyx_k_centrality_type), 0, 0, 1, 1},
  {&__pyx_n_s_cfg, __pyx_k_cfg, sizeof(__pyx_k_cfg), 0, 0, 1, 1},
  {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1},
  {&__pyx_n_b_classifier, __pyx_k_classifier, sizeof(__pyx_k_classifier), 0, 0, 0, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clear_impl, __pyx_k_clear_impl, sizeof(__pyx_k_clear_impl), 0, 0, 1, 1},
  {&__pyx_n_b_clustering, __pyx_k_clustering, sizeof(__pyx_k_clustering), 0, 0, 0, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_dat, __pyx_k_dat, sizeof(__pyx_k_dat), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_degree, __pyx_k_degree, sizeof(__pyx_k_degree), 0, 0, 1, 1},
  {&__pyx_n_s_do_mix, __pyx_k_do_mix, sizeof(__pyx_k_do_mix), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_edge_id, __pyx_k_edge_id, sizeof(__pyx_k_edge_id), 0, 0, 1, 1},
  {&__pyx_n_s_edge_query, __pyx_k_edge_query, sizeof(__pyx_k_edge_query), 0, 0, 1, 1},
  {&__pyx_n_s_embedded_jubatus, __pyx_k_embedded_jubatus, sizeof(__pyx_k_embedded_jubatus), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_from_id, __pyx_k_from_id, sizeof(__pyx_k_from_id), 0, 0, 1, 1},
  {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1},
  {&__pyx_n_s_get_client, __pyx_k_get_client, sizeof(__pyx_k_get_client), 0, 0, 1, 1},
  {&__pyx_n_s_get_config, __pyx_k_get_config, sizeof(__pyx_k_get_config), 0, 0, 1, 1},
  {&__pyx_n_s_get_model_path, __pyx_k_get_model_path, sizeof(__pyx_k_get_model_path), 0, 0, 1, 1},
  {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1},
  {&__pyx_n_s_get_proxy_status, __pyx_k_get_proxy_status, sizeof(__pyx_k_get_proxy_status), 0, 0, 1, 1},
  {&__pyx_n_s_get_status, __pyx_k_get_status, sizeof(__pyx_k_get_status), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_b_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 0, 1},
  {&__pyx_kp_s_home_jubatus_Development_embedd, __pyx_k_home_jubatus_Development_embedd, sizeof(__pyx_k_home_jubatus_Development_embedd), 0, 0, 1, 0},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_kp_s_host___port, __pyx_k_host___port, sizeof(__pyx_k_host___port), 0, 0, 1, 0},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_id_2, __pyx_k_id_2, sizeof(__pyx_k_id_2), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  {&__pyx_n_s_init_locals_lambda, __pyx_k_init_locals_lambda, sizeof(__pyx_k_init_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_kp_s_invalid_X_shape, __pyx_k_invalid_X_shape, sizeof(__pyx_k_invalid_X_shape), 0, 0, 1, 0},
  {&__pyx_kp_s_invalid_shape, __pyx_k_invalid_shape, sizeof(__pyx_k_invalid_shape), 0, 0, 1, 0},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_anomaly_types, __pyx_k_jubatus_anomaly_types, sizeof(__pyx_k_jubatus_anomaly_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_bandit_types, __pyx_k_jubatus_bandit_types, sizeof(__pyx_k_jubatus_bandit_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_burst_types, __pyx_k_jubatus_burst_types, sizeof(__pyx_k_jubatus_burst_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_classifier_types, __pyx_k_jubatus_classifier_types, sizeof(__pyx_k_jubatus_classifier_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_clustering_types, __pyx_k_jubatus_clustering_types, sizeof(__pyx_k_jubatus_clustering_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_common_datum, __pyx_k_jubatus_common_datum, sizeof(__pyx_k_jubatus_common_datum), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_graph_types, __pyx_k_jubatus_graph_types, sizeof(__pyx_k_jubatus_graph_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_nearest_neighbor_types, __pyx_k_jubatus_nearest_neighbor_types, sizeof(__pyx_k_jubatus_nearest_neighbor_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_recommender_types, __pyx_k_jubatus_recommender_types, sizeof(__pyx_k_jubatus_recommender_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_regression_types, __pyx_k_jubatus_regression_types, sizeof(__pyx_k_jubatus_regression_types), 0, 0, 1, 1},
  {&__pyx_n_s_jubatus_weight_types, __pyx_k_jubatus_weight_types, sizeof(__pyx_k_jubatus_weight_types), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keyword, __pyx_k_keyword, sizeof(__pyx_k_keyword), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
  {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
  {&__pyx_n_s_load_bytes, __pyx_k_load_bytes, sizeof(__pyx_k_load_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_max_hop, __pyx_k_max_hop, sizeof(__pyx_k_max_hop), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 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_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_b_nearest_neighbor, __pyx_k_nearest_neighbor, sizeof(__pyx_k_nearest_neighbor), 0, 0, 0, 1},
  {&__pyx_n_s_new_name, __pyx_k_new_name, sizeof(__pyx_k_new_name), 0, 0, 1, 1},
  {&__pyx_n_s_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1},
  {&__pyx_n_s_node_query, __pyx_k_node_query, sizeof(__pyx_k_node_query), 0, 0, 1, 1},
  {&__pyx_n_s_num_values, __pyx_k_num_values, sizeof(__pyx_k_num_values), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_partial_fit, __pyx_k_partial_fit, sizeof(__pyx_k_partial_fit), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_player_id, __pyx_k_player_id, sizeof(__pyx_k_player_id), 0, 0, 1, 1},
  {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_props, __pyx_k_props, sizeof(__pyx_k_props), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_b_recommender, __pyx_k_recommender, sizeof(__pyx_k_recommender), 0, 0, 0, 1},
  {&__pyx_n_b_regression, __pyx_k_regression, sizeof(__pyx_k_regression), 0, 0, 0, 1},
  {&__pyx_n_s_reward, __pyx_k_reward, sizeof(__pyx_k_reward), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1},
  {&__pyx_n_s_save_bytes, __pyx_k_save_bytes, sizeof(__pyx_k_save_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_scaling_param, __pyx_k_scaling_param, sizeof(__pyx_k_scaling_param), 0, 0, 1, 1},
  {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_sort_keys, __pyx_k_sort_keys, sizeof(__pyx_k_sort_keys), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_b_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 0, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_string_values, __pyx_k_string_values, sizeof(__pyx_k_string_values), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  {&__pyx_kp_s_tmp_host___port___type___id_jub, __pyx_k_tmp_host___port___type___id_jub, sizeof(__pyx_k_tmp_host___port___type___id_jub), 0, 0, 1, 0},
  {&__pyx_n_s_to_id, __pyx_k_to_id, sizeof(__pyx_k_to_id), 0, 0, 1, 1},
  {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__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_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1},
  {&__pyx_n_b_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 0, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 61, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 66, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 100, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 18, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 41, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(13, 989, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "embedded_jubatus.pyx":66
 *         if isinstance(config, str):
 *             # loads config from file
 *             config = open(config, 'rb').read().decode('utf8')             # <<<<<<<<<<<<<<
 *             # JSON parse test
 *             json.loads(config)
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "embedded_jubatus.pyx":72
 *             config = json.dumps(config, sort_keys=True, indent=4)
 *         (self.get_config, self.save_bytes, self.load_bytes,
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))             # <<<<<<<<<<<<<<
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "embedded_jubatus.pyx":74
 *          self._clear_impl, typ) = self._init(config.encode('utf8'))
 *         if str != bytes and isinstance(typ, bytes):
 *             typ = typ.decode('ascii')             # <<<<<<<<<<<<<<
 *         self._type = typ
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "embedded_jubatus.pyx":89
 *     def load(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             self.load_bytes(f.read())
 *         return True
 */
  __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "embedded_jubatus.pyx":95
 *     def save(self, id_):
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.write(self.save_bytes())
 *         return {name: path}
 */
  __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "src/types.pyx":4
 *     d.string_values_.clear()
 *     for k, v in pd.string_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         v = v.encode('utf8')
 *         d.string_values_.push_back(pair[string, string](k, v))
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "src/types.pyx":5
 *     for k, v in pd.string_values:
 *         k = k.encode('utf8')
 *         v = v.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.string_values_.push_back(pair[string, string](k, v))
 *     d.num_values_.clear()
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "src/types.pyx":9
 *     d.num_values_.clear()
 *     for k, v in pd.num_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.num_values_.push_back(pair[string, double](k, v))
 *     d.binary_values_.clear()
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "src/types.pyx":13
 *     d.binary_values_.clear()
 *     for k, v in pd.binary_values:
 *         k = k.encode('utf8')             # <<<<<<<<<<<<<<
 *         d.binary_values_.push_back(pair[string, string](k, v))
 * 
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "src/types.pyx":72
 * cdef props_py2native(p, prop_t& out):
 *     for k, v in p.items():
 *         out.insert(pair[string, string](k.encode('utf8'), v.encode('utf8')))             # <<<<<<<<<<<<<<
 * 
 * cdef props_native2py(prop_t& p):
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "src/types.pyx":89
 *     for x in query.edge_query:
 *         q.edge_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))             # <<<<<<<<<<<<<<
 *     for x in query.node_query:
 *         q.node_query.push_back(pair[string, string](
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "src/types.pyx":92
 *     for x in query.node_query:
 *         q.node_query.push_back(pair[string, string](
 *             x.from_id.encode('ascii'), x.to_id.encode('ascii')))             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "src/anomaly.pyx":23
 * 
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "src/anomaly.pyx":36
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.update(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 * 
 *     def overwrite(self, id_, row):
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "src/anomaly.pyx":41
 *         cdef datum d
 *         datum_py2native(row, d)
 *         return self._handle.overwrite(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 * 
 *     def calc_score(self, row):
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "src/bandit.pyx":23
 * 
 *     def register_arm(self, arm_id):
 *         return self._handle.register_arm(arm_id.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def delete_arm(self, arm_id):
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "src/bandit.pyx":26
 * 
 *     def delete_arm(self, arm_id):
 *         return self._handle.delete_arm(arm_id.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def select_arm(self, player_id):
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "src/bandit.pyx":29
 * 
 *     def select_arm(self, player_id):
 *         return self._handle.select_arm(player_id.encode('utf8')).decode('utf8')             # <<<<<<<<<<<<<<
 * 
 *     def register_reward(self, player_id, arm_id, reward):
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "src/bandit.pyx":33
 *     def register_reward(self, player_id, arm_id, reward):
 *         return self._handle.register_reward(
 *             player_id.encode('utf8'), arm_id.encode('utf8'), reward)             # <<<<<<<<<<<<<<
 * 
 *     def get_arm_info(self, player_id):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "src/bandit.pyx":37
 *     def get_arm_info(self, player_id):
 *         cdef map[string, arm_info] r
 *         r = self._handle.get_arm_info(player_id.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return {
 *             it.first.decode('utf8'): ArmInfo(it.second.trial_count, it.second.weight)
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "src/bandit.pyx":44
 * 
 *     def reset(self, player_id):
 *         return self._handle.reset(player_id.encode('utf8'))             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "src/burst.pyx":36
 *         ret = 0
 *         for doc in data:
 *             if self._handle.add_document(doc.text.encode('utf8'), doc.pos):             # <<<<<<<<<<<<<<
 *                 ret += 1
 *         if ret > 0:
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "src/burst.pyx":43
 * 
 *     def get_result(self, keyword):
 *         return _to_window(self._handle.get_result(keyword.encode('utf8')))             # <<<<<<<<<<<<<<
 * 
 *     def get_result_at(self, keyword, pos):
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "src/burst.pyx":46
 * 
 *     def get_result_at(self, keyword, pos):
 *         return _to_window(self._handle.get_result_at(keyword.encode('utf8'), pos))             # <<<<<<<<<<<<<<
 * 
 *     def get_all_bursted_results(self):
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(5, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "src/burst.pyx":70
 *         kp.scaling_param = keyword.scaling_param
 *         kp.gamma = keyword.gamma
 *         return self._handle.add_keyword(keyword.keyword.encode('utf8'), kp)             # <<<<<<<<<<<<<<
 * 
 *     def remove_keyword(self, keyword):
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "src/burst.pyx":73
 * 
 *     def remove_keyword(self, keyword):
 *         return self._handle.remove_keyword(keyword.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def remove_all_keywords(self):
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(5, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "src/classifier.pyx":32
 *                 for r in data:
 *                     label, datum = r.label, r.data
 *                     l = label.encode('utf8')             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "src/classifier.pyx":37
 *             elif isinstance(data[0], (tuple, list)) and len(data[0]) == 2:
 *                 for label, datum in data:
 *                     l = label.encode('utf8')             # <<<<<<<<<<<<<<
 *                     datum_py2native(datum, d)
 *                     self._handle.train(l, d)
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "src/classifier.pyx":67
 * 
 *     def set_label(self, new_label):
 *         return self._handle.set_label(new_label.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def delete_label(self, target_label):
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "src/classifier.pyx":70
 * 
 *     def delete_label(self, target_label):
 *         return self._handle.delete_label(target_label.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def fit(self, X, y):
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "src/classifier.pyx":80
 *         import numpy as np
 *         if len(X.shape) != 2 or len(y.shape) != 1 or X.shape[0] != y.shape[0]:
 *             raise ValueError('invalid shape')             # <<<<<<<<<<<<<<
 *         cdef int i, j, max_label
 *         cdef rows = X.shape[0]
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_invalid_shape); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "src/classifier.pyx":109
 *         import numpy as np
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')             # <<<<<<<<<<<<<<
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_invalid_X_shape); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "src/classifier.pyx":153
 *         import numpy as np
 *         if len(X.shape) != 2:
 *             raise ValueError('invalid X.shape')             # <<<<<<<<<<<<<<
 *         cdef int is_ndarray = isinstance(X, np.ndarray)
 *         cdef int is_csr = (type(X).__name__ == 'csr_matrix')
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_invalid_X_shape); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "src/clustering.pyx":28
 *         for p in points:
 *             datum_py2native(p.point, d)
 *             ip.id = p.id.encode('utf8')             # <<<<<<<<<<<<<<
 *             ip.point = d
 *             v.push_back(ip)
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "src/nearest_neighbor.pyx":25
 *         cdef datum d
 *         datum_py2native(row, d)
 *         self._handle.set_row(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "src/nearest_neighbor.pyx":30
 *     def neighbor_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.neighbor_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "src/nearest_neighbor.pyx":48
 *     def similar_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             NNIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(7, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "src/recommender.pyx":23
 * 
 *     def clear_row(self, id_):
 *         self._handle.clear_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "src/recommender.pyx":29
 *         cdef datum d
 *         datum_py2native(row, d)
 *         self._handle.update_row(id_.encode('utf8'), d)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "src/recommender.pyx":33
 * 
 *     def complete_row_from_id(self, id_):
 *         cdef datum d = self._handle.complete_row_from_id(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return datum_native2py(d)
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(8, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "src/recommender.pyx":44
 *     def similar_row_from_id(self, id_, size):
 *         cdef vector[pair[string, float]] ret
 *         ret = self._handle.similar_row_from_id(id_.encode('utf8'), size)             # <<<<<<<<<<<<<<
 *         return [
 *             RecommenderIdWithScore(ret[i].first.decode('utf8'), ret[i].second)
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "src/recommender.pyx":61
 * 
 *     def decode_row(self, id_):
 *         cdef datum d = self._handle.decode_row(id_.encode('utf8'))             # <<<<<<<<<<<<<<
 *         return datum_native2py(d)
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "src/stat.pyx":23
 * 
 *     def push(self, key, value):
 *         self._handle.push(key.encode('utf8'), value)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(10, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "src/stat.pyx":27
 * 
 *     def sum(self, key):
 *         return self._handle.sum(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def stddev(self, key):
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "src/stat.pyx":30
 * 
 *     def stddev(self, key):
 *         return self._handle.stddev(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def max(self, key):
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(10, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "src/stat.pyx":33
 * 
 *     def max(self, key):
 *         return self._handle.max(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def min(self, key):
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "src/stat.pyx":36
 * 
 *     def min(self, key):
 *         return self._handle.min(key.encode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     def entropy(self, key):
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(10, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "src/stat.pyx":42
 * 
 *     def moment(self, key, degree, center):
 *         return self._handle.moment(key.encode('utf8'), degree, center)             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(10, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "src/graph.pyx":26
 * 
 *     def remove_node(self, node_id):
 *         return self._handle.remove_node(node_id.encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *     def update_node(self, node_id, props):
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "src/graph.pyx":31
 *         cdef prop_t p
 *         props_py2native(props, p)
 *         return self._handle.update_node(node_id.encode('ascii'), p)             # <<<<<<<<<<<<<<
 * 
 *     def create_edge(self, node_id, e):
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "src/graph.pyx":40
 *         cdef prop_t p
 *         props_py2native(e.property, p)
 *         return self._handle.create_edge(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                         e.target.encode('ascii'), p)
 * 
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(12, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "src/graph.pyx":41
 *         props_py2native(e.property, p)
 *         return self._handle.create_edge(node_id.encode('ascii'),
 *                                         e.target.encode('ascii'), p)             # <<<<<<<<<<<<<<
 * 
 *     def update_edge(self, node_id, edge_id, e):
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "src/graph.pyx":60
 *         cdef preset_query q
 *         preset_query_py2native(query, q)
 *         return self._handle.get_centrality(node_id.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            centrality_type, q)
 * 
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "src/graph.pyx":101
 *         cdef vector[node_id_t] r
 *         preset_query_py2native(query.query, q)
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            query.target.encode('ascii'),
 *                                            query.max_hop, q)
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(12, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "src/graph.pyx":102
 *         preset_query_py2native(query.query, q)
 *         r = self._handle.get_shortest_path(query.source.encode('ascii'),
 *                                            query.target.encode('ascii'),             # <<<<<<<<<<<<<<
 *                                            query.max_hop, q)
 *         return [str(x) for x in r]
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "src/graph.pyx":112
 *     def get_node(self, node_id):
 *         cdef node_info n
 *         n = self._handle.get_node(node_id.encode('ascii'))             # <<<<<<<<<<<<<<
 *         return Node(props_native2py(n.property),
 *                     edges_native2py(n.in_edges),
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(12, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(13, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(13, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(13, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(13, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(13, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(13, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(13, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "../../.pyenv/versions/local-system/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(13, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "embedded_jubatus.pyx":62
 * 
 * class _JubatusBase(object):
 *     def __init__(self, config):             # <<<<<<<<<<<<<<
 *         import json
 *         if isinstance(config, str):
 */
  __pyx_tuple__70 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_config, __pyx_n_s_json, __pyx_n_s_typ); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_init_2, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 62, __pyx_L1_error)

  /* "embedded_jubatus.pyx":77
 *         self._type = typ
 * 
 *     def _get_model_path(self, id_):             # <<<<<<<<<<<<<<
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 */
  __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_id, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_path); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_get_model_path, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 77, __pyx_L1_error)

  /* "embedded_jubatus.pyx":83
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._clear_impl()
 *         return True
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_clear, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "embedded_jubatus.pyx":87
 *         return True
 * 
 *     def load(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:
 */
  __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_id, __pyx_n_s_path, __pyx_n_s_name_2, __pyx_n_s_f); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_load, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 87, __pyx_L1_error)

  /* "embedded_jubatus.pyx":93
 *         return True
 * 
 *     def save(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:
 */
  __pyx_tuple__78 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_id, __pyx_n_s_path, __pyx_n_s_name_2, __pyx_n_s_f); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_save, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 93, __pyx_L1_error)

  /* "embedded_jubatus.pyx":99
 *         return {name: path}
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_get_status, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 99, __pyx_L1_error)

  /* "embedded_jubatus.pyx":102
 *         raise RuntimeError
 * 
 *     def do_mix(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_do_mix, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 102, __pyx_L1_error)

  /* "embedded_jubatus.pyx":105
 *         raise RuntimeError
 * 
 *     def get_proxy_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_get_proxy_status, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 105, __pyx_L1_error)

  /* "embedded_jubatus.pyx":108
 *         raise RuntimeError
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_get_name, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 108, __pyx_L1_error)

  /* "embedded_jubatus.pyx":111
 *         raise RuntimeError
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_new_name); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_set_name, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 111, __pyx_L1_error)

  /* "embedded_jubatus.pyx":114
 *         raise RuntimeError
 * 
 *     def get_client(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_get_client, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 114, __pyx_L1_error)

  /* "embedded_jubatus.pyx":117
 *         raise RuntimeError
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.get_config(), self.save_bytes())
 * 
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_getstate, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 117, __pyx_L1_error)

  /* "embedded_jubatus.pyx":120
 *         return (self.get_config(), self.save_bytes())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         import json
 *         cfg, model = state
 */
  __pyx_tuple__94 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_json, __pyx_n_s_cfg, __pyx_n_s_model); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_jubatus_Development_embedd, __pyx_n_s_setstate, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initembedded_jubatus(void); /*proto*/
PyMODINIT_FUNC initembedded_jubatus(void)
#else
PyMODINIT_FUNC PyInit_embedded_jubatus(void); /*proto*/
PyMODINIT_FUNC PyInit_embedded_jubatus(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_embedded_jubatus(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("embedded_jubatus", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_embedded_jubatus) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "embedded_jubatus")) {
      if (unlikely(PyDict_SetItemString(modules, "embedded_jubatus", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__AnomalyWrapper) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__AnomalyWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_AnomalyWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__AnomalyWrapper) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__AnomalyWrapper = &__pyx_type_16embedded_jubatus__AnomalyWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__BanditWrapper) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__BanditWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_BanditWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__BanditWrapper) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__BanditWrapper = &__pyx_type_16embedded_jubatus__BanditWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__BurstWrapper) < 0) __PYX_ERR(5, 12, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__BurstWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_BurstWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__BurstWrapper) < 0) __PYX_ERR(5, 12, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__BurstWrapper = &__pyx_type_16embedded_jubatus__BurstWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__ClassifierWrapper) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__ClassifierWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_ClassifierWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__ClassifierWrapper) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__ClassifierWrapper = &__pyx_type_16embedded_jubatus__ClassifierWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__ClusteringWrapper) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__ClusteringWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_ClusteringWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__ClusteringWrapper) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__ClusteringWrapper = &__pyx_type_16embedded_jubatus__ClusteringWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__NearestNeighborWrapper) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__NearestNeighborWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_NearestNeighborWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__NearestNeighborWrapper) < 0) __PYX_ERR(7, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__NearestNeighborWrapper = &__pyx_type_16embedded_jubatus__NearestNeighborWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__RecommenderWrapper) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__RecommenderWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_RecommenderWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__RecommenderWrapper) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__RecommenderWrapper = &__pyx_type_16embedded_jubatus__RecommenderWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__RegressionWrapper) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__RegressionWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_RegressionWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__RegressionWrapper) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__RegressionWrapper = &__pyx_type_16embedded_jubatus__RegressionWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__StatWrapper) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__StatWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_StatWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__StatWrapper) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__StatWrapper = &__pyx_type_16embedded_jubatus__StatWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__WeightWrapper) < 0) __PYX_ERR(11, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__WeightWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_WeightWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__WeightWrapper) < 0) __PYX_ERR(11, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__WeightWrapper = &__pyx_type_16embedded_jubatus__WeightWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus__GraphWrapper) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_type_16embedded_jubatus__GraphWrapper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_GraphWrapper", (PyObject *)&__pyx_type_16embedded_jubatus__GraphWrapper) < 0) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_ptype_16embedded_jubatus__GraphWrapper = &__pyx_type_16embedded_jubatus__GraphWrapper;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct___init) < 0) __PYX_ERR(3, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct___init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct___init = &__pyx_type_16embedded_jubatus___pyx_scope_struct___init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_1__init) < 0) __PYX_ERR(4, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_1__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_1__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_1__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_2__init) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_2__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_2__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_2__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_3__init) < 0) __PYX_ERR(2, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_3__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_3__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_3__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_4__init) < 0) __PYX_ERR(6, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_4__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_4__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_4__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_5__init) < 0) __PYX_ERR(7, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_5__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_5__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_5__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_6__init) < 0) __PYX_ERR(8, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_6__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_6__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_6__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_7__init) < 0) __PYX_ERR(9, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_7__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_7__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_7__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_8__init) < 0) __PYX_ERR(10, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_8__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_8__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_8__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_9__init) < 0) __PYX_ERR(11, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_9__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_9__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_9__init;
  if (PyType_Ready(&__pyx_type_16embedded_jubatus___pyx_scope_struct_10__init) < 0) __PYX_ERR(12, 11, __pyx_L1_error)
  __pyx_type_16embedded_jubatus___pyx_scope_struct_10__init.tp_print = 0;
  __pyx_ptype_16embedded_jubatus___pyx_scope_struct_10__init = &__pyx_type_16embedded_jubatus___pyx_scope_struct_10__init;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(15, 9, __pyx_L1_error)
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(13, 155, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(13, 168, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(13, 172, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(13, 181, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(13, 861, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "embedded_jubatus.pyx":39
 * from _wrapper cimport indexed_point
 * 
 * from jubatus.anomaly.types import IdWithScore as AnomalyIdWithScore             # <<<<<<<<<<<<<<
 * from jubatus.bandit.types import ArmInfo
 * from jubatus.burst.types import Batch
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_IdWithScore);
  __Pyx_GIVEREF(__pyx_n_s_IdWithScore);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdWithScore);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_anomaly_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_IdWithScore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AnomalyIdWithScore, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":40
 * 
 * from jubatus.anomaly.types import IdWithScore as AnomalyIdWithScore
 * from jubatus.bandit.types import ArmInfo             # <<<<<<<<<<<<<<
 * from jubatus.burst.types import Batch
 * from jubatus.burst.types import Document
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ArmInfo);
  __Pyx_GIVEREF(__pyx_n_s_ArmInfo);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ArmInfo);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_bandit_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ArmInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArmInfo, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":41
 * from jubatus.anomaly.types import IdWithScore as AnomalyIdWithScore
 * from jubatus.bandit.types import ArmInfo
 * from jubatus.burst.types import Batch             # <<<<<<<<<<<<<<
 * from jubatus.burst.types import Document
 * from jubatus.burst.types import KeywordWithParams
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Batch);
  __Pyx_GIVEREF(__pyx_n_s_Batch);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Batch);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_burst_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Batch, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":42
 * from jubatus.bandit.types import ArmInfo
 * from jubatus.burst.types import Batch
 * from jubatus.burst.types import Document             # <<<<<<<<<<<<<<
 * from jubatus.burst.types import KeywordWithParams
 * from jubatus.burst.types import Window
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Document);
  __Pyx_GIVEREF(__pyx_n_s_Document);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Document);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_burst_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Document); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Document, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":43
 * from jubatus.burst.types import Batch
 * from jubatus.burst.types import Document
 * from jubatus.burst.types import KeywordWithParams             # <<<<<<<<<<<<<<
 * from jubatus.burst.types import Window
 * from jubatus.classifier.types import EstimateResult
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_KeywordWithParams);
  __Pyx_GIVEREF(__pyx_n_s_KeywordWithParams);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_KeywordWithParams);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_burst_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_KeywordWithParams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KeywordWithParams, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":44
 * from jubatus.burst.types import Document
 * from jubatus.burst.types import KeywordWithParams
 * from jubatus.burst.types import Window             # <<<<<<<<<<<<<<
 * from jubatus.classifier.types import EstimateResult
 * from jubatus.classifier.types import LabeledDatum
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Window);
  __Pyx_GIVEREF(__pyx_n_s_Window);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Window);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_burst_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Window); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Window, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":45
 * from jubatus.burst.types import KeywordWithParams
 * from jubatus.burst.types import Window
 * from jubatus.classifier.types import EstimateResult             # <<<<<<<<<<<<<<
 * from jubatus.classifier.types import LabeledDatum
 * from jubatus.clustering.types import WeightedDatum
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_EstimateResult);
  __Pyx_GIVEREF(__pyx_n_s_EstimateResult);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_EstimateResult);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_classifier_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_EstimateResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EstimateResult, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":46
 * from jubatus.burst.types import Window
 * from jubatus.classifier.types import EstimateResult
 * from jubatus.classifier.types import LabeledDatum             # <<<<<<<<<<<<<<
 * from jubatus.clustering.types import WeightedDatum
 * from jubatus.clustering.types import WeightedIndex
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_LabeledDatum);
  __Pyx_GIVEREF(__pyx_n_s_LabeledDatum);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LabeledDatum);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_classifier_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_LabeledDatum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LabeledDatum, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":47
 * from jubatus.classifier.types import EstimateResult
 * from jubatus.classifier.types import LabeledDatum
 * from jubatus.clustering.types import WeightedDatum             # <<<<<<<<<<<<<<
 * from jubatus.clustering.types import WeightedIndex
 * from jubatus.common.datum import Datum
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_WeightedDatum);
  __Pyx_GIVEREF(__pyx_n_s_WeightedDatum);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WeightedDatum);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_clustering_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WeightedDatum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WeightedDatum, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":48
 * from jubatus.classifier.types import LabeledDatum
 * from jubatus.clustering.types import WeightedDatum
 * from jubatus.clustering.types import WeightedIndex             # <<<<<<<<<<<<<<
 * from jubatus.common.datum import Datum
 * from jubatus.nearest_neighbor.types import IdWithScore as NNIdWithScore
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_WeightedIndex);
  __Pyx_GIVEREF(__pyx_n_s_WeightedIndex);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_WeightedIndex);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_clustering_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_WeightedIndex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WeightedIndex, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":49
 * from jubatus.clustering.types import WeightedDatum
 * from jubatus.clustering.types import WeightedIndex
 * from jubatus.common.datum import Datum             # <<<<<<<<<<<<<<
 * from jubatus.nearest_neighbor.types import IdWithScore as NNIdWithScore
 * from jubatus.recommender.types import IdWithScore as RecommenderIdWithScore
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Datum);
  __Pyx_GIVEREF(__pyx_n_s_Datum);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Datum);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_common_datum, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Datum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Datum, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":50
 * from jubatus.clustering.types import WeightedIndex
 * from jubatus.common.datum import Datum
 * from jubatus.nearest_neighbor.types import IdWithScore as NNIdWithScore             # <<<<<<<<<<<<<<
 * from jubatus.recommender.types import IdWithScore as RecommenderIdWithScore
 * from jubatus.regression.types import ScoredDatum
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_IdWithScore);
  __Pyx_GIVEREF(__pyx_n_s_IdWithScore);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IdWithScore);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_nearest_neighbor_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IdWithScore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NNIdWithScore, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":51
 * from jubatus.common.datum import Datum
 * from jubatus.nearest_neighbor.types import IdWithScore as NNIdWithScore
 * from jubatus.recommender.types import IdWithScore as RecommenderIdWithScore             # <<<<<<<<<<<<<<
 * from jubatus.regression.types import ScoredDatum
 * from jubatus.weight.types import Feature
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_IdWithScore);
  __Pyx_GIVEREF(__pyx_n_s_IdWithScore);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdWithScore);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_recommender_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_IdWithScore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecommenderIdWithScore, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":52
 * from jubatus.nearest_neighbor.types import IdWithScore as NNIdWithScore
 * from jubatus.recommender.types import IdWithScore as RecommenderIdWithScore
 * from jubatus.regression.types import ScoredDatum             # <<<<<<<<<<<<<<
 * from jubatus.weight.types import Feature
 * from jubatus.graph.types import Edge
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ScoredDatum);
  __Pyx_GIVEREF(__pyx_n_s_ScoredDatum);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ScoredDatum);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_regression_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ScoredDatum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScoredDatum, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":53
 * from jubatus.recommender.types import IdWithScore as RecommenderIdWithScore
 * from jubatus.regression.types import ScoredDatum
 * from jubatus.weight.types import Feature             # <<<<<<<<<<<<<<
 * from jubatus.graph.types import Edge
 * from jubatus.graph.types import Node
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Feature);
  __Pyx_GIVEREF(__pyx_n_s_Feature);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Feature);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_weight_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Feature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Feature, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":54
 * from jubatus.regression.types import ScoredDatum
 * from jubatus.weight.types import Feature
 * from jubatus.graph.types import Edge             # <<<<<<<<<<<<<<
 * from jubatus.graph.types import Node
 * from jubatus.graph.types import PresetQuery
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Edge);
  __Pyx_GIVEREF(__pyx_n_s_Edge);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Edge);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_graph_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Edge, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":55
 * from jubatus.weight.types import Feature
 * from jubatus.graph.types import Edge
 * from jubatus.graph.types import Node             # <<<<<<<<<<<<<<
 * from jubatus.graph.types import PresetQuery
 * from jubatus.graph.types import Query
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Node);
  __Pyx_GIVEREF(__pyx_n_s_Node);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Node);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_graph_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Node, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":56
 * from jubatus.graph.types import Edge
 * from jubatus.graph.types import Node
 * from jubatus.graph.types import PresetQuery             # <<<<<<<<<<<<<<
 * from jubatus.graph.types import Query
 * from jubatus.graph.types import ShortestPathQuery
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_PresetQuery);
  __Pyx_GIVEREF(__pyx_n_s_PresetQuery);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PresetQuery);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_graph_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PresetQuery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PresetQuery, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":57
 * from jubatus.graph.types import Node
 * from jubatus.graph.types import PresetQuery
 * from jubatus.graph.types import Query             # <<<<<<<<<<<<<<
 * from jubatus.graph.types import ShortestPathQuery
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Query);
  __Pyx_GIVEREF(__pyx_n_s_Query);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Query);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_jubatus_graph_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Query, __pyx_t_1) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":58
 * from jubatus.graph.types import PresetQuery
 * from jubatus.graph.types import Query
 * from jubatus.graph.types import ShortestPathQuery             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ShortestPathQuery);
  __Pyx_GIVEREF(__pyx_n_s_ShortestPathQuery);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ShortestPathQuery);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_jubatus_graph_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ShortestPathQuery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShortestPathQuery, __pyx_t_2) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":61
 * 
 * 
 * class _JubatusBase(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, config):
 *         import json
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_JubatusBase, __pyx_n_s_JubatusBase, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "embedded_jubatus.pyx":62
 * 
 * class _JubatusBase(object):
 *     def __init__(self, config):             # <<<<<<<<<<<<<<
 *         import json
 *         if isinstance(config, str):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_1__init__, 0, __pyx_n_s_JubatusBase___init, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":77
 *         self._type = typ
 * 
 *     def _get_model_path(self, id_):             # <<<<<<<<<<<<<<
 *         host, port = '127.0.0.1', 0
 *         path = '/tmp/{host}_{port}_{type}_{id}.jubatus'.format(
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_3_get_model_path, 0, __pyx_n_s_JubatusBase__get_model_path, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_model_path, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":83
 *         return (path, '{host}_{port}'.format(host=host, port=port))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._clear_impl()
 *         return True
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_5clear, 0, __pyx_n_s_JubatusBase_clear, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_clear, __pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":87
 *         return True
 * 
 *     def load(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'rb') as f:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_7load, 0, __pyx_n_s_JubatusBase_load, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_load, __pyx_t_4) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":93
 *         return True
 * 
 *     def save(self, id_):             # <<<<<<<<<<<<<<
 *         path, name = self._get_model_path(id_)
 *         with open(path, 'wb') as f:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_9save, 0, __pyx_n_s_JubatusBase_save, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_save, __pyx_t_4) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":99
 *         return {name: path}
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_11get_status, 0, __pyx_n_s_JubatusBase_get_status, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_status, __pyx_t_4) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":102
 *         raise RuntimeError
 * 
 *     def do_mix(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_13do_mix, 0, __pyx_n_s_JubatusBase_do_mix, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_do_mix, __pyx_t_4) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":105
 *         raise RuntimeError
 * 
 *     def get_proxy_status(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_15get_proxy_status, 0, __pyx_n_s_JubatusBase_get_proxy_status, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_proxy_status, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":108
 *         raise RuntimeError
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_17get_name, 0, __pyx_n_s_JubatusBase_get_name, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_name, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":111
 *         raise RuntimeError
 * 
 *     def set_name(self, new_name):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_19set_name, 0, __pyx_n_s_JubatusBase_set_name, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_set_name, __pyx_t_4) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":114
 *         raise RuntimeError
 * 
 *     def get_client(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_21get_client, 0, __pyx_n_s_JubatusBase_get_client, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_client, __pyx_t_4) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":117
 *         raise RuntimeError
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.get_config(), self.save_bytes())
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_23__getstate__, 0, __pyx_n_s_JubatusBase___getstate, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getstate, __pyx_t_4) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":120
 *         return (self.get_config(), self.save_bytes())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         import json
 *         cfg, model = state
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16embedded_jubatus_12_JubatusBase_25__setstate__, 0, __pyx_n_s_JubatusBase___setstate, NULL, __pyx_n_s_embedded_jubatus, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_setstate, __pyx_t_4) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "embedded_jubatus.pyx":61
 * 
 * 
 * class _JubatusBase(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, config):
 *         import json
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_JubatusBase, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JubatusBase, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":139
 * include 'graph.pyx'
 * 
 * class Anomaly(_JubatusBase, _AnomalyWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__AnomalyWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__AnomalyWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__AnomalyWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Anomaly, __pyx_n_s_Anomaly, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Anomaly, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Anomaly, __pyx_t_4) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":142
 *     pass
 * 
 * class Bandit(_JubatusBase, _BanditWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__BanditWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__BanditWrapper));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__BanditWrapper));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Bandit, __pyx_n_s_Bandit, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Bandit, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Bandit, __pyx_t_4) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":145
 *     pass
 * 
 * class Burst(_JubatusBase, _BurstWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__BurstWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__BurstWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__BurstWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Burst, __pyx_n_s_Burst, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Burst, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Burst, __pyx_t_4) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":148
 *     pass
 * 
 * class Classifier(_JubatusBase, _ClassifierWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__ClassifierWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__ClassifierWrapper));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__ClassifierWrapper));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Classifier, __pyx_n_s_Classifier, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Classifier, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Classifier, __pyx_t_4) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":151
 *     pass
 * 
 * class Clustering(_JubatusBase, _ClusteringWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__ClusteringWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__ClusteringWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__ClusteringWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Clustering, __pyx_n_s_Clustering, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Clustering, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clustering, __pyx_t_4) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":154
 *     pass
 * 
 * class NearestNeighbor(_JubatusBase, _NearestNeighborWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__NearestNeighborWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__NearestNeighborWrapper));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__NearestNeighborWrapper));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NearestNeighbor, __pyx_n_s_NearestNeighbor, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NearestNeighbor, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NearestNeighbor, __pyx_t_4) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":157
 *     pass
 * 
 * class Recommender(_JubatusBase, _RecommenderWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__RecommenderWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__RecommenderWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__RecommenderWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Recommender, __pyx_n_s_Recommender, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Recommender, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Recommender, __pyx_t_4) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":160
 *     pass
 * 
 * class Regression(_JubatusBase, _RegressionWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__RegressionWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__RegressionWrapper));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__RegressionWrapper));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Regression, __pyx_n_s_Regression, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Regression, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Regression, __pyx_t_4) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":163
 *     pass
 * 
 * class Stat(_JubatusBase, _StatWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__StatWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__StatWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__StatWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Stat, __pyx_n_s_Stat, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Stat, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Stat, __pyx_t_4) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":166
 *     pass
 * 
 * class Weight(_JubatusBase, _WeightWrapper):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__WeightWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__WeightWrapper));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__WeightWrapper));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Weight, __pyx_n_s_Weight, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Weight, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Weight, __pyx_t_4) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "embedded_jubatus.pyx":169
 *     pass
 * 
 * class Graph(_JubatusBase, _GraphWrapper):             # <<<<<<<<<<<<<<
 *     pass
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_JubatusBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_16embedded_jubatus__GraphWrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_16embedded_jubatus__GraphWrapper));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_16embedded_jubatus__GraphWrapper));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Graph, __pyx_n_s_Graph, (PyObject *) NULL, __pyx_n_s_embedded_jubatus, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Graph, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Graph, __pyx_t_4) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "embedded_jubatus.pyx":1
 * from libc.stdint cimport uint64_t             # <<<<<<<<<<<<<<
 * from libcpp.string cimport string
 * from libcpp.vector cimport vector
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init embedded_jubatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init embedded_jubatus");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

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

/* 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);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
    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());
    return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
}
#endif  // CYTHON_FAST_PYCCALL

/* 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 = PyThreadState_GET();
    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  // CPython < 3.6
#endif  // CYTHON_FAST_PYCALL

/* 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
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#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) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* RaiseTooManyValuesToUnpack */
    static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
    static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
    static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
    static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* SaveResetException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

/* RaiseException */
      #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* GetModuleGlobalName */
        static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* decode_c_bytes */
          static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* BufferFormatCheck */
          static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

/* BufferIndexError */
            static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* KeywordStringCheck */
            static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* None */
            static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* FetchCommonType */
            static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
            static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_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(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
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 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
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 (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* PyIntBinop */
                #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* GetItemInt */
                static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_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));
}

/* 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(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyObjectCallMethod1 */
                static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto done;
#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);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
done:
    Py_XDECREF(method);
    return result;
}

/* append */
                static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* SetItemInt */
                static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

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

/* RaiseNoneIterError */
                  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* PyErrExceptionMatches */
                  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* ImportFrom */
                  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
                  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
                  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CodeObjectCache */
                  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
                  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


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

/* 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_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= 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_intptr_t),
                                     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_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= 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(uint64_t),
                                     little, !is_unsigned);
    }
}

/* Declarations */
                  #if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
                  #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = 1.0 / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = 1.0 / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0, -1);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
                  #if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
                  #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = 1.0 / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = 1.0 / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0, -1);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum NPY_TYPES) <= 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(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
                  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) 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 (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_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
#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 (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, 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 (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((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(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_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
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, 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
            size_t 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 (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -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 uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) 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 (uint64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) >= 4 * PyLong_SHIFT) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)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 (uint64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, 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 (uint64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, 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
            uint64_t 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 (uint64_t) -1;
        }
    } else {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -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;
}

/* CheckBinaryVersion */
                  static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* ModuleImport */
                  #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
                  #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* InitStrings */
                  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
#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 = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
  #else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
  #endif
#else
  res = PyNumber_Int(x);
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
