/* Generated by Cython 0.21 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_21"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
#endif


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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__pykeyvi
#define __PYX_HAVE_API__pykeyvi
#include "string.h"
#include <string>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <utility>
#include <set>
#include <vector>
#include <map>
#include "boost/smart_ptr/shared_ptr.hpp"
#include "autowrap_tools.hpp"
#include "stdint.h"
#include "dictionary/match.h"
#include "dictionary/match_iterator.h"
#include "dictionary/dictionary.h"
#include "dictionary/util/jump_consistent_hash.h"
#include "dictionary/dictionary_types.h"
#include "dictionary/completion/forward_backward_completion.h"
#include "transform/fsa_transform.h"
#include "dictionary/completion/multiword_completion.h"
#include "compression/predictive_compression.h"
#include "dictionary/completion/prefix_completion.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING "ascii  # for cython>=0.19"
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


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

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


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

/*--- Type declarations ---*/
struct __pyx_obj_7pykeyvi_JsonDictionaryMerger;
struct __pyx_obj_7pykeyvi_StringDictionaryCompiler;
struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler;
struct __pyx_obj_7pykeyvi_Dictionary;
struct __pyx_obj_7pykeyvi_FsaTransform;
struct __pyx_obj_7pykeyvi_PrefixCompletion;
struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion;
struct __pyx_obj_7pykeyvi_loading_strategy_types;
struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData;
struct __pyx_obj_7pykeyvi_MultiWordCompletion;
struct __pyx_obj_7pykeyvi_PredictiveCompression;
struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator;
struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler;
struct __pyx_obj_7pykeyvi_Match;
struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler;
struct __pyx_obj_7pykeyvi_MatchIterator;
struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr;
struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr;

/* "dictionary_compiler.pxd":6
 * from libc.string cimport const_char
 * 
 * ctypedef void (*callback_t)(size_t a, size_t b, void* user_data)             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "dictionary/dictionary_types.h" namespace "keyvi::dictionary":
 */
typedef void (*__pyx_t_19dictionary_compiler_callback_t)(size_t, size_t, void *);

/* "dictionary_merger.pxd":7
 * from libcpp cimport bool
 * 
 * ctypedef void (*callback_t)(size_t a, size_t b, void* user_data)             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "dictionary/dictionary_types.h" namespace "keyvi::dictionary":
 */
typedef void (*__pyx_t_17dictionary_merger_callback_t)(size_t, size_t, void *);

/* "pykeyvi.pyx":47
 *     return py_result
 * 
 * cdef class JsonDictionaryMerger:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_JsonDictionaryMerger] inst
 */
struct __pyx_obj_7pykeyvi_JsonDictionaryMerger {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::JsonDictionaryMerger>  inst;
};


/* "pykeyvi.pyx":99
 *         self.inst.get().SetManifestFromString(m)
 * 
 * cdef class StringDictionaryCompiler:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_StringDictionaryCompiler] inst
 */
struct __pyx_obj_7pykeyvi_StringDictionaryCompiler {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::StringDictionaryCompiler>  inst;
};


/* "pykeyvi.pyx":182
 *         self.inst.get().SetManifestFromString(m)
 * 
 * cdef class JsonDictionaryCompiler:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_JsonDictionaryCompiler] inst
 */
struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompiler>  inst;
};


/* "pykeyvi.pyx":265
 *         self.inst.get().SetManifestFromString(m)
 * 
 * cdef class Dictionary:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_Dictionary] inst
 */
struct __pyx_obj_7pykeyvi_Dictionary {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::Dictionary>  inst;
};


/* "pykeyvi.pyx":445
 *         )}
 * 
 * cdef class FsaTransform:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_FsaTransform] inst
 */
struct __pyx_obj_7pykeyvi_FsaTransform {
  PyObject_HEAD
  boost::shared_ptr<keyvi::transform::FsaTransform>  inst;
};


/* "pykeyvi.pyx":466
 *         self.inst = shared_ptr[_FsaTransform](new _FsaTransform(input_in_0))
 * 
 * cdef class PrefixCompletion:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_PrefixCompletion] inst
 */
struct __pyx_obj_7pykeyvi_PrefixCompletion {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::completion::PrefixCompletion>  inst;
};


/* "pykeyvi.pyx":501
 *         return py_result
 * 
 * cdef class ForwardBackwardCompletion:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_ForwardBackwardCompletion] inst
 */
struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::completion::ForwardBackwardCompletion>  inst;
};


/* "pykeyvi.pyx":546
 *         self.inst = shared_ptr[_ForwardBackwardCompletion](new _ForwardBackwardCompletion(input_in_0, input_in_1))
 * 
 * cdef class loading_strategy_types:             # <<<<<<<<<<<<<<
 *     default_os = 0
 *     lazy = 1
 */
struct __pyx_obj_7pykeyvi_loading_strategy_types {
  PyObject_HEAD
};


/* "pykeyvi.pyx":556
 *     populate_key_part_no_readahead_value_part = 7
 * 
 * cdef class JsonDictionaryCompilerSmallData:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_JsonDictionaryCompilerSmallData] inst
 */
struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompilerSmallData>  inst;
};


/* "pykeyvi.pyx":642
 *         self.inst.get().SetManifestFromString(m)
 * 
 * cdef class MultiWordCompletion:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_MultiWordCompletion] inst
 */
struct __pyx_obj_7pykeyvi_MultiWordCompletion {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::completion::MultiWordCompletion>  inst;
};


/* "pykeyvi.pyx":685
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 * cdef class PredictiveCompression:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_PredictiveCompression] inst
 */
struct __pyx_obj_7pykeyvi_PredictiveCompression {
  PyObject_HEAD
  boost::shared_ptr<keyvi::compression::PredictiveCompression>  inst;
};


/* "pykeyvi.pyx":715
 *         return py_result
 * 
 * cdef class KeyOnlyDictionaryGenerator:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_KeyOnlyDictionaryGenerator] inst
 */
struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryGenerator>  inst;
};


/* "pykeyvi.pyx":741
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 * cdef class KeyOnlyDictionaryCompiler:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_KeyOnlyDictionaryCompiler] inst
 */
struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryCompiler>  inst;
};


/* "pykeyvi.pyx":811
 *         self.inst.get().SetManifestFromString(m)
 * 
 * cdef class Match:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_Match] inst
 */
struct __pyx_obj_7pykeyvi_Match {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::Match>  inst;
};


/* "pykeyvi.pyx":985
 *         return m
 * 
 * cdef class CompletionDictionaryCompiler:             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[_CompletionDictionaryCompiler] inst
 */
struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler {
  PyObject_HEAD
  boost::shared_ptr<keyvi::dictionary::CompletionDictionaryCompiler>  inst;
};


/* "pykeyvi.pyx":1083
 * from match_iterator cimport MatchIterator as _MatchIterator
 * 
 * cdef class MatchIterator:             # <<<<<<<<<<<<<<
 *     cdef _MatchIterator it
 *     cdef _MatchIterator end
 */
struct __pyx_obj_7pykeyvi_MatchIterator {
  PyObject_HEAD
  keyvi::dictionary::MatchIterator it;
  keyvi::dictionary::MatchIterator end;
};


/* "pykeyvi.pyx":63
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":65
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":73
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":78
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":115
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":117
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":125
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":130
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":207
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":209
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":217
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":222
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":397
 *         return py_result
 * 
 *     def _key_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetMatchedString()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper {
  PyObject_HEAD
  PyObject *__pyx_v_iterator;
  PyObject *__pyx_v_m;
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":401
 *             yield m.GetMatchedString()
 * 
 *     def _value_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetValue()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper {
  PyObject_HEAD
  PyObject *__pyx_v_iterator;
  PyObject *__pyx_v_m;
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":405
 *             yield m.GetValue()
 * 
 *     def _item_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield (m.GetMatchedString(), m.GetValue())
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper {
  PyObject_HEAD
  PyObject *__pyx_v_iterator;
  PyObject *__pyx_v_m;
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":579
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":581
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":589
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":594
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":757
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":759
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":767
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":772
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":1017
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 {
  PyObject_HEAD
  PyObject *__pyx_v_value_store_params;
};


/* "pykeyvi.pyx":1019
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pykeyvi.pyx":1027
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
};


/* "pykeyvi.pyx":1032
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_v;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};

#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)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

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

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

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

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

#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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);

static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

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

#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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

#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);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#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);

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

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

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback);

#include <string.h>

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

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

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

#include <new>

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

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

static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

#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::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

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);

#define __Pyx_Generator_USED
#include <structmember.h>
#include <frameobject.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    int resume_label;
    char is_running;
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure, PyObject *name, PyObject *qualname);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_clear(PyObject* self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


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

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

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

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

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

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

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

/* Module declarations from 'smart_ptr' */

/* Module declarations from 'AutowrapRefHolder' */

/* Module declarations from 'AutowrapPtrHolder' */

/* Module declarations from 'AutowrapConstPtrHolder' */

/* Module declarations from 'libcpp' */

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

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

/* Module declarations from 'match' */

/* Module declarations from 'match_iterator' */

/* Module declarations from 'dictionary' */

/* Module declarations from 'cluster' */

/* Module declarations from 'dictionary_compiler' */

/* Module declarations from 'forward_backward_completion' */

/* Module declarations from 'normalization' */

/* Module declarations from 'dictionary_merger' */

/* Module declarations from 'generator' */

/* Module declarations from 'multi_word_completion' */

/* Module declarations from 'predictive_compression' */

/* Module declarations from 'prefix_completion' */

/* Module declarations from 'pykeyvi' */
static PyTypeObject *__pyx_ptype_7pykeyvi_JsonDictionaryMerger = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_StringDictionaryCompiler = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_JsonDictionaryCompiler = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_Dictionary = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_FsaTransform = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_PrefixCompletion = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_ForwardBackwardCompletion = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_loading_strategy_types = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_JsonDictionaryCompilerSmallData = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_MultiWordCompletion = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_PredictiveCompression = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_KeyOnlyDictionaryGenerator = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_KeyOnlyDictionaryCompiler = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_Match = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_CompletionDictionaryCompiler = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi_MatchIterator = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct___init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_2_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_3___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_4_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_6__init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_7_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_9___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_10_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_11_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_12__init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_13_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_15___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_16_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_17_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_21__init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_22_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_23_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_24___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_25_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_26_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_27__init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_28_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_29_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_30___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_31_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_32_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_33__init_2 = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_34_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_35_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_36___init__ = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_37_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pykeyvi___pyx_scope_struct_38_genexpr = 0;
static void __pyx_f_7pykeyvi_callback_wrapper(size_t, size_t, void *); /*proto*/
static std::string __pyx_convert_string_from_py_(PyObject *); /*proto*/
static PyObject *__pyx_convert_string_to_py_(std::string const &); /*proto*/
#define __Pyx_MODULE_NAME "pykeyvi"
int __pyx_module_is_main_pykeyvi = 0;

/* Implementation of 'pykeyvi' */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_all;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_filter;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_pf_7pykeyvi_JumpConsistentHashString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static void __pyx_pf_7pykeyvi_20JsonDictionaryMerger___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_2_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_4_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_6_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_10Merge(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_12Add(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_14SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static void __pyx_pf_7pykeyvi_24StringDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_2_init_0(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_4_init_1(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_6_init_2(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_10Add(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static int __pyx_pf_7pykeyvi_24StringDictionaryCompiler_12__setitem__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static void __pyx_pf_7pykeyvi_22JsonDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_2Add(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_4_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_6_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_10__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_12__setitem__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static void __pyx_pf_7pykeyvi_10Dictionary___dealloc__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_2LookupText(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_4Lookup(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_6_GetNear_0(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_minimum_prefix_length); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_8_GetNear_1(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_minimum_prefix_length, PyObject *__pyx_v_greedy); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_10GetNear(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_12_init_0(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_14_init_1(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_in_1); /* proto */
static int __pyx_pf_7pykeyvi_10Dictionary_16__init__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_18Get(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_20get(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */
static int __pyx_pf_7pykeyvi_10Dictionary_22__contains__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static Py_ssize_t __pyx_pf_7pykeyvi_10Dictionary_24__len__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_26__getitem__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_28_key_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_31_value_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_34_item_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_37GetAllKeys(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_39GetAllValues(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_41GetAllItems(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_43GetManifest(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kv); /* proto */
static PyObject *__pyx_pf_7pykeyvi_10Dictionary_45GetStatistics(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self); /* proto */
static void __pyx_pf_7pykeyvi_12FsaTransform___dealloc__(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_12FsaTransform_2Normalize(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static int __pyx_pf_7pykeyvi_12FsaTransform_4__init__(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0); /* proto */
static void __pyx_pf_7pykeyvi_16PrefixCompletion___dealloc__(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_16PrefixCompletion_2GetFuzzyCompletions(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_max_edit_distance); /* proto */
static int __pyx_pf_7pykeyvi_16PrefixCompletion_4__init__(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_16PrefixCompletion_6GetCompletions(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static void __pyx_pf_7pykeyvi_25ForwardBackwardCompletion___dealloc__(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_2_GetCompletions_0(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_4_GetCompletions_1(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_6GetCompletions(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_8__init__(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_1); /* proto */
static void __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self); /* proto */
static int __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_2__setitem__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_4_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_6_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_10__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_12WriteToFile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_14__enter__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_16__exit__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_18Add(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_20Compile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_22SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static void __pyx_pf_7pykeyvi_19MultiWordCompletion___dealloc__(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self); /* proto */
static int __pyx_pf_7pykeyvi_19MultiWordCompletion_2__init__(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_4_GetCompletions_0(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_6_GetCompletions_1(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_8GetCompletions(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static void __pyx_pf_7pykeyvi_21PredictiveCompression___dealloc__(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_21PredictiveCompression_2Compress(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static int __pyx_pf_7pykeyvi_21PredictiveCompression_4__init__(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_21PredictiveCompression_6Uncompress(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static void __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator___dealloc__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self); /* proto */
static int __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_2__init__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_4Add(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_6CloseFeeding(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_8WriteToFile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static void __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_2_init_0(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_4_init_1(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_6_init_2(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_10Add(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_12WriteToFile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_14__enter__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_16__exit__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_18Compile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_20SetManifest(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static void __pyx_pf_7pykeyvi_5Match___dealloc__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_2SetEnd(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_end); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_4GetStart(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_6GetScore(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_8SetMatchedString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_matched_string); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_10GetValueAsString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_12IsEmpty(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_14SetScore(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, float __pyx_v_score); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_16GetRawValueAsString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_18SetStart(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_start); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_20GetEnd(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_22__copy__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_24__deepcopy__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_26_init_0(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_28_init_1(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, struct __pyx_obj_7pykeyvi_Match *__pyx_v_m); /* proto */
static int __pyx_pf_7pykeyvi_5Match_30__init__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_32GetMatchedString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_34GetAttribute(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_36SetAttribute(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_38GetValue(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_40dumps(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_42__SetRawValue(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_str); /* proto */
static PyObject *__pyx_pf_7pykeyvi_5Match_44loads(PyObject *__pyx_v_serialized_match); /* proto */
static void __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self); /* proto */
static int __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_2__setitem__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_4Add(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_6_init_0(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8_init_1(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_10_init_2(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_12__init__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest); /* proto */
static PyObject *__pyx_pf_7pykeyvi_13MatchIterator___iter__(struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pykeyvi_13MatchIterator_2__next__(struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_7pykeyvi_JsonDictionaryMerger(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_StringDictionaryCompiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_JsonDictionaryCompiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_Dictionary(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_FsaTransform(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_PrefixCompletion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_ForwardBackwardCompletion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_loading_strategy_types(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_JsonDictionaryCompilerSmallData(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_MultiWordCompletion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_PredictiveCompression(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_KeyOnlyDictionaryGenerator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_KeyOnlyDictionaryCompiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_Match(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_CompletionDictionaryCompiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi_MatchIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct___init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_3___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_6__init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_9___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_12__init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_15___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_21__init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_24___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_26_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_27__init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_28_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_30___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_31_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_32_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_33__init_2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_34_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_35_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_36___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_37_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_38_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_m[] = "m";
static char __pyx_k_r[] = "_r";
static char __pyx_k__23[] = "\n\n";
static char __pyx_k__25[] = "\n";
static char __pyx_k_all[] = "all";
static char __pyx_k_key[] = "key";
static char __pyx_k_args[] = "args";
static char __pyx_k_in_0[] = "in_0";
static char __pyx_k_in_1[] = "in_1";
static char __pyx_k_json[] = "json";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_lazy[] = "lazy";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_send[] = "send";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_type[] = "type";
static char __pyx_k_UTF_8[] = "UTF-8";
static char __pyx_k_close[] = "close";
static char __pyx_k_dumps[] = "dumps";
static char __pyx_k_items[] = "items";
static char __pyx_k_loads[] = "loads";
static char __pyx_k_split[] = "split";
static char __pyx_k_throw[] = "throw";
static char __pyx_k_utf_8[] = "utf-8";
static char __pyx_k_value[] = "value";
static char __pyx_k_SetEnd[] = "SetEnd";
static char __pyx_k_encode[] = "encode";
static char __pyx_k_filter[] = "filter";
static char __pyx_k_greedy[] = "greedy";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_init_0[] = "_init_0";
static char __pyx_k_init_1[] = "_init_1";
static char __pyx_k_init_2[] = "_init_2";
static char __pyx_k_rstrip[] = "rstrip";
static char __pyx_k_values[] = "values";
static char __pyx_k_Compile[] = "Compile";
static char __pyx_k_default[] = "default";
static char __pyx_k_genexpr[] = "genexpr";
static char __pyx_k_msgpack[] = "msgpack";
static char __pyx_k_pykeyvi[] = "pykeyvi";
static char __pyx_k_GetValue[] = "GetValue";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_SetScore[] = "SetScore";
static char __pyx_k_SetStart[] = "SetStart";
static char __pyx_k_filename[] = "filename";
static char __pyx_k_populate[] = "populate";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_GetNear_0[] = "_GetNear_0";
static char __pyx_k_GetNear_1[] = "_GetNear_1";
static char __pyx_k_py_result[] = "py_result";
static char __pyx_k_traceback[] = "traceback";
static char __pyx_k_default_os[] = "default_os";
static char __pyx_k_input_in_0[] = "input_in_0";
static char __pyx_k_SetRawValue[] = "__SetRawValue";
static char __pyx_k_memory_limit[] = "memory_limit";
static char __pyx_k_staticmethod[] = "staticmethod";
static char __pyx_k_unserialized[] = "unserialized";
static char __pyx_k_StopIteration[] = "StopIteration";
static char __pyx_k_populate_lazy[] = "populate_lazy";
static char __pyx_k_GetCompletions_0[] = "_GetCompletions_0";
static char __pyx_k_GetCompletions_1[] = "_GetCompletions_1";
static char __pyx_k_GetMatchedString[] = "GetMatchedString";
static char __pyx_k_SetMatchedString[] = "SetMatchedString";
static char __pyx_k_arg_m_wrong_type[] = "arg m wrong type";
static char __pyx_k_number_of_fields[] = "number_of_fields";
static char __pyx_k_serialized_match[] = "serialized_match";
static char __pyx_k_lazy_no_readahead[] = "lazy_no_readahead";
static char __pyx_k_max_edit_distance[] = "max_edit_distance";
static char __pyx_k_populate_key_part[] = "populate_key_part";
static char __pyx_k_arg_end_wrong_type[] = "arg end wrong type";
static char __pyx_k_value_store_params[] = "value_store_params";
static char __pyx_k_arg_in_0_wrong_type[] = "arg in_0 wrong type";
static char __pyx_k_arg_in_1_wrong_type[] = "arg in_1 wrong type";
static char __pyx_k_arg_score_wrong_type[] = "arg score wrong type";
static char __pyx_k_arg_start_wrong_type[] = "arg start wrong type";
static char __pyx_k_key_iterator_wrapper[] = "_key_iterator_wrapper";
static char __pyx_k_arg_greedy_wrong_type[] = "arg greedy wrong type";
static char __pyx_k_init_2_locals_genexpr[] = "_init_2.<locals>.genexpr";
static char __pyx_k_init___locals_genexpr[] = "__init__.<locals>.genexpr";
static char __pyx_k_item_iterator_wrapper[] = "_item_iterator_wrapper";
static char __pyx_k_minimum_prefix_length[] = "minimum_prefix_length";
static char __pyx_k_Unsupported_Value_Type[] = "Unsupported Value Type";
static char __pyx_k_value_iterator_wrapper[] = "_value_iterator_wrapper";
static char __pyx_k_arg_filename_wrong_type[] = "arg filename wrong type";
static char __pyx_k_JumpConsistentHashString[] = "JumpConsistentHashString";
static char __pyx_k_can_not_handle_type_of_s[] = "can not handle type of %s";
static char __pyx_k_GetStatistics_locals_lambda[] = "GetStatistics.<locals>.<lambda>";
static char __pyx_k_arg_memory_limit_wrong_type[] = "arg memory_limit wrong type";
static char __pyx_k_lazy_no_readahead_value_part[] = "lazy_no_readahead_value_part";
static char __pyx_k_arg_matched_string_wrong_type[] = "arg matched_string wrong type";
static char __pyx_k_Users_narek_projects_keyvi_pyke[] = "/Users/narek/projects/keyvi/pykeyvi/src/pykeyvi.pyx";
static char __pyx_k_arg_minimum_prefix_length_wrong[] = "arg minimum_prefix_length wrong type";
static char __pyx_k_Dictionary__item_iterator_wrappe[] = "Dictionary._item_iterator_wrapper";
static char __pyx_k_Dictionary__key_iterator_wrapper[] = "Dictionary._key_iterator_wrapper";
static char __pyx_k_Dictionary__value_iterator_wrapp[] = "Dictionary._value_iterator_wrapper";
static char __pyx_k_arg_max_edit_distance_wrong_type[] = "arg max_edit_distance wrong type";
static char __pyx_k_arg_value_store_params_wrong_typ[] = "arg value_store_params wrong type";
static char __pyx_k_populate_key_part_no_readahead_v[] = "populate_key_part_no_readahead_value_part";
static PyObject *__pyx_n_s_Compile;
static PyObject *__pyx_n_s_Dictionary__item_iterator_wrappe;
static PyObject *__pyx_n_s_Dictionary__key_iterator_wrapper;
static PyObject *__pyx_n_s_Dictionary__value_iterator_wrapp;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_n_s_GetCompletions_0;
static PyObject *__pyx_n_s_GetCompletions_1;
static PyObject *__pyx_n_s_GetMatchedString;
static PyObject *__pyx_n_s_GetNear_0;
static PyObject *__pyx_n_s_GetNear_1;
static PyObject *__pyx_n_s_GetStatistics_locals_lambda;
static PyObject *__pyx_n_s_GetValue;
static PyObject *__pyx_n_s_JumpConsistentHashString;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_SetEnd;
static PyObject *__pyx_n_s_SetMatchedString;
static PyObject *__pyx_n_s_SetRawValue;
static PyObject *__pyx_n_s_SetScore;
static PyObject *__pyx_n_s_SetStart;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_s_UTF_8;
static PyObject *__pyx_kp_s_Unsupported_Value_Type;
static PyObject *__pyx_kp_s_Users_narek_projects_keyvi_pyke;
static PyObject *__pyx_kp_s__23;
static PyObject *__pyx_kp_s__25;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_kp_s_arg_end_wrong_type;
static PyObject *__pyx_kp_s_arg_filename_wrong_type;
static PyObject *__pyx_kp_s_arg_greedy_wrong_type;
static PyObject *__pyx_kp_s_arg_in_0_wrong_type;
static PyObject *__pyx_kp_s_arg_in_1_wrong_type;
static PyObject *__pyx_kp_s_arg_m_wrong_type;
static PyObject *__pyx_kp_s_arg_matched_string_wrong_type;
static PyObject *__pyx_kp_s_arg_max_edit_distance_wrong_type;
static PyObject *__pyx_kp_s_arg_memory_limit_wrong_type;
static PyObject *__pyx_kp_s_arg_minimum_prefix_length_wrong;
static PyObject *__pyx_kp_s_arg_score_wrong_type;
static PyObject *__pyx_kp_s_arg_start_wrong_type;
static PyObject *__pyx_kp_s_arg_value_store_params_wrong_typ;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_kp_s_can_not_handle_type_of_s;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_default_os;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_filter;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_greedy;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_0;
static PyObject *__pyx_n_s_in_1;
static PyObject *__pyx_n_s_init_0;
static PyObject *__pyx_n_s_init_1;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_init_2_locals_genexpr;
static PyObject *__pyx_n_s_init___locals_genexpr;
static PyObject *__pyx_n_s_input_in_0;
static PyObject *__pyx_n_s_item_iterator_wrapper;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_key_iterator_wrapper;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_lazy;
static PyObject *__pyx_n_s_lazy_no_readahead;
static PyObject *__pyx_n_s_lazy_no_readahead_value_part;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max_edit_distance;
static PyObject *__pyx_n_s_memory_limit;
static PyObject *__pyx_n_s_minimum_prefix_length;
static PyObject *__pyx_n_s_msgpack;
static PyObject *__pyx_n_s_number_of_fields;
static PyObject *__pyx_n_s_populate;
static PyObject *__pyx_n_s_populate_key_part;
static PyObject *__pyx_n_s_populate_key_part_no_readahead_v;
static PyObject *__pyx_n_s_populate_lazy;
static PyObject *__pyx_n_s_py_result;
static PyObject *__pyx_n_s_pykeyvi;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_rstrip;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_serialized_match;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_unserialized;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_value_iterator_wrapper;
static PyObject *__pyx_n_s_value_store_params;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
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__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__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__51;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;

/* "pykeyvi.pyx":38
 *     char * _cast_const_away(char *)
 * 
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_1JumpConsistentHashString(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pykeyvi_1JumpConsistentHashString = {"JumpConsistentHashString", (PyCFunction)__pyx_pw_7pykeyvi_1JumpConsistentHashString, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pykeyvi_1JumpConsistentHashString(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("JumpConsistentHashString (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("JumpConsistentHashString", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "JumpConsistentHashString") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = ((PyObject*)values[0]);
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("JumpConsistentHashString", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JumpConsistentHashString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), (&PyBytes_Type), 1, "in_0", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_JumpConsistentHashString(__pyx_self, __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_JumpConsistentHashString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  const char *__pyx_v_input_in_0;
  uint32_t __pyx_v__r;
  uint32_t __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  const char *__pyx_t_4;
  uint32_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("JumpConsistentHashString", 0);

  /* "pykeyvi.pyx":39
 * 
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *     cdef const_char * input_in_0 = <const_char *> in_0
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_0); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":40
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *     cdef const_char * input_in_0 = <const_char *> in_0
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":41
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *     cdef const_char * input_in_0 = <const_char *> in_0             # <<<<<<<<<<<<<<
 * 
 *     cdef uint32_t _r = _JumpConsistentHashString_cluster(input_in_0, (<uint32_t>in_1))
 */
  __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_in_0); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_in_0 = ((const char *)__pyx_t_4);

  /* "pykeyvi.pyx":43
 *     cdef const_char * input_in_0 = <const_char *> in_0
 * 
 *     cdef uint32_t _r = _JumpConsistentHashString_cluster(input_in_0, (<uint32_t>in_1))             # <<<<<<<<<<<<<<
 *     py_result = <uint32_t>_r
 *     return py_result
 */
  __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_in_1); if (unlikely((__pyx_t_5 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = keyvi::dictionary::util::JumpConsistentHashString(__pyx_v_input_in_0, ((uint32_t)__pyx_t_5));

  /* "pykeyvi.pyx":44
 * 
 *     cdef uint32_t _r = _JumpConsistentHashString_cluster(input_in_0, (<uint32_t>in_1))
 *     py_result = <uint32_t>_r             # <<<<<<<<<<<<<<
 *     return py_result
 * 
 */
  __pyx_v_py_result = ((uint32_t)__pyx_v__r);

  /* "pykeyvi.pyx":45
 *     cdef uint32_t _r = _JumpConsistentHashString_cluster(input_in_0, (<uint32_t>in_1))
 *     py_result = <uint32_t>_r
 *     return py_result             # <<<<<<<<<<<<<<
 * 
 * cdef class JsonDictionaryMerger:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_py_result); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":38
 *     char * _cast_const_away(char *)
 * 
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

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

/* "pykeyvi.pyx":51
 *     cdef shared_ptr[_JsonDictionaryMerger] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_20JsonDictionaryMerger_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_20JsonDictionaryMerger_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_20JsonDictionaryMerger___dealloc__(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_20JsonDictionaryMerger___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":52
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":51
 *     cdef shared_ptr[_JsonDictionaryMerger] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":55
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_2_init_0(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_2_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::JsonDictionaryMerger *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":56
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::JsonDictionaryMerger();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryMerger> (__pyx_t_1);

  /* "pykeyvi.pyx":55
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger())
 * 
 */

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

/* "pykeyvi.pyx":58
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_4_init_1(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_4_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::JsonDictionaryMerger *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":59
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":61
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::JsonDictionaryMerger(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryMerger> (__pyx_t_5);

  /* "pykeyvi.pyx":58
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":63
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_6_init_2(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_2generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":65
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_1_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_2generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_2generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_5generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_2_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_5generator4, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_7_init_2_5generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":63
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_6_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::JsonDictionaryMerger *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct___init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct___init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":64
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":65
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":67
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":68
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":69
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":68
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":70
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::JsonDictionaryMerger(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryMerger> (__pyx_t_16);

  /* "pykeyvi.pyx":71
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":63
 *         self.inst = shared_ptr[_JsonDictionaryMerger](new _JsonDictionaryMerger((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":73
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_20JsonDictionaryMerger_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_20JsonDictionaryMerger_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init__(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___2generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":78
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_4_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___2generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___2generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___5generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_5_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___5generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_20JsonDictionaryMerger_8__init___5generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":73
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_3___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_3___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":74
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":75
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":76
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":77
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":78
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":79
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":81
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def Merge(self,  in_0 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":73
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":83
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Merge(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_11Merge(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_11Merge(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Merge (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_10Merge(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_10Merge(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Merge", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":84
 * 
 *     def Merge(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":85
 *     def Merge(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Merge((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":86
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Merge((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":87
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Merge((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def Add(self,  in_0 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->Merge(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":83
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Merge(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger.Merge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":89
 *         self.inst.get().Merge((<libcpp_string>in_0))
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_13Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_13Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_12Add(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_12Add(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":90
 * 
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":91
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":92
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":93
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def SetManifest(self, manifest):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":89
 *         self.inst.get().Merge((<libcpp_string>in_0))
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":95
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_15SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_20JsonDictionaryMerger_15SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_20JsonDictionaryMerger_14SetManifest(((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_20JsonDictionaryMerger_14SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":96
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":97
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * cdef class StringDictionaryCompiler:
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_m); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);

  /* "pykeyvi.pyx":95
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryMerger.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":103
 *     cdef shared_ptr[_StringDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_24StringDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_24StringDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_24StringDictionaryCompiler___dealloc__(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_24StringDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":104
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":103
 *     cdef shared_ptr[_StringDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":107
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_2_init_0(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_2_init_0(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::StringDictionaryCompiler *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":108
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::StringDictionaryCompiler();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::StringDictionaryCompiler> (__pyx_t_1);

  /* "pykeyvi.pyx":107
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler())
 * 
 */

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

/* "pykeyvi.pyx":110
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_4_init_1(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_4_init_1(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::StringDictionaryCompiler *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":111
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":113
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::StringDictionaryCompiler(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::StringDictionaryCompiler> (__pyx_t_5);

  /* "pykeyvi.pyx":110
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":115
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_6_init_2(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":117
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_7_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_2generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_8_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_5generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_7_init_2_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":115
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_6_init_2(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::StringDictionaryCompiler *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_6__init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct_6__init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":116
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":117
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":119
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":120
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":121
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":120
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":122
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::StringDictionaryCompiler(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::StringDictionaryCompiler> (__pyx_t_16);

  /* "pykeyvi.pyx":123
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":115
 *         self.inst = shared_ptr[_StringDictionaryCompiler](new _StringDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":125
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_24StringDictionaryCompiler_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_24StringDictionaryCompiler_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init__(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":130
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_10_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_10_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___2generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___5generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_11_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_11_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___5generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_24StringDictionaryCompiler_8__init___5generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":125
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_9___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_9___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":126
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":127
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":128
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":129
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":130
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":131
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":133
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def Add(self,  in_0 ,  in_1 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":125
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":135
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_11Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_11Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_10Add(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_10Add(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);
  __Pyx_INCREF(__pyx_v_in_1);

  /* "pykeyvi.pyx":136
 * 
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":137
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":138
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":139
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":140
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):             # <<<<<<<<<<<<<<
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_in_1); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":141
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_1, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pykeyvi.pyx":142
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_convert_string_from_py_(__pyx_v_in_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6), ((std::string)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":135
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XDECREF(__pyx_v_in_1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":144
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_24StringDictionaryCompiler_13__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /*proto*/
static int __pyx_pw_7pykeyvi_24StringDictionaryCompiler_13__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_12__setitem__(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0), ((PyObject *)__pyx_v_in_1));

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

static int __pyx_pf_7pykeyvi_24StringDictionaryCompiler_12__setitem__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_in_0);
  __Pyx_INCREF(__pyx_v_in_1);

  /* "pykeyvi.pyx":145
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":146
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":147
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":148
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":149
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):             # <<<<<<<<<<<<<<
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_in_1); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":150
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_1, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pykeyvi.pyx":151
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self,  in_0 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_convert_string_from_py_(__pyx_v_in_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->__setitem__(((std::string)__pyx_t_6), ((std::string)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":144
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XDECREF(__pyx_v_in_1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":153
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_14WriteToFile(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":154
 * 
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":155
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":156
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":157
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->WriteToFile(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":153
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.WriteToFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":159
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_16__enter__(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pykeyvi.pyx":160
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":159
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":163
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,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_type)) != 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("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_18__exit__(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pykeyvi.pyx":164
 * 
 *     def __exit__(self, type, value, traceback):
 *         self.Compile()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __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;

  /* "pykeyvi.pyx":163
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":167
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compile (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Compile", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_20Compile(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args) {
  void *__pyx_v_callback;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("Compile", 0);

  /* "pykeyvi.pyx":168
 * 
 *     def Compile(self, *args):
 *         if not args:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 self.inst.get().Compile()
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":169
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "pykeyvi.pyx":170
 *         if not args:
 *             with nogil:
 *                 self.inst.get().Compile()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
          __pyx_v_self->inst.get()->Compile();
        }

        /* "pykeyvi.pyx":169
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pykeyvi.pyx":171
 *             with nogil:
 *                 self.inst.get().Compile()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef void* callback = <void*> args[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":173
 *             return
 * 
 *         cdef void* callback = <void*> args[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)
 */
  __pyx_v_callback = ((void *)PyTuple_GET_ITEM(__pyx_v_args, 0));

  /* "pykeyvi.pyx":174
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "pykeyvi.pyx":175
 *         cdef void* callback = <void*> args[0]
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_self->inst.get()->Compile(__pyx_f_7pykeyvi_callback_wrapper, __pyx_v_callback);
      }

      /* "pykeyvi.pyx":174
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "pykeyvi.pyx":167
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

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

/* "pykeyvi.pyx":178
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_24StringDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_24StringDictionaryCompiler_22SetManifest(((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_24StringDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":179
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":180
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * cdef class JsonDictionaryCompiler:
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_m); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);

  /* "pykeyvi.pyx":178
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.StringDictionaryCompiler.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":186
 *     cdef shared_ptr[_JsonDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_22JsonDictionaryCompiler___dealloc__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_22JsonDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":187
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":186
 *     cdef shared_ptr[_JsonDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":190
 * 
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_3Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_3Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_2Add(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_2Add(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);
  __Pyx_INCREF(__pyx_v_in_1);

  /* "pykeyvi.pyx":191
 * 
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":192
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":193
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":194
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":195
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):             # <<<<<<<<<<<<<<
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_in_1); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":196
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_1, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pykeyvi.pyx":197
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def _init_0(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_convert_string_from_py_(__pyx_v_in_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6), ((std::string)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":190
 * 
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XDECREF(__pyx_v_in_1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":199
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_5_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_5_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_4_init_0(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_4_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::JsonDictionaryCompiler *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":200
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::JsonDictionaryCompiler();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompiler> (__pyx_t_1);

  /* "pykeyvi.pyx":199
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler())
 * 
 */

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

/* "pykeyvi.pyx":202
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_7_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_7_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_6_init_1(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_6_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::JsonDictionaryCompiler *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":203
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":205
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::JsonDictionaryCompiler(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompiler> (__pyx_t_5);

  /* "pykeyvi.pyx":202
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":207
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_9_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_9_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8_init_2(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":209
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_13_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_2generator11, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_5generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_14_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_5generator12, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_7_init_2_5generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":207
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::JsonDictionaryCompiler *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_12__init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct_12__init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":208
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":209
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":211
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":212
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":213
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":212
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":214
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::JsonDictionaryCompiler(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompiler> (__pyx_t_16);

  /* "pykeyvi.pyx":215
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":207
 *         self.inst = shared_ptr[_JsonDictionaryCompiler](new _JsonDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":217
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_10__init__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":222
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_16_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___2generator13, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___5generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_17_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___5generator14, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_22JsonDictionaryCompiler_8__init___5generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":217
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_10__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_15___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_15___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":218
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":219
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":220
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":221
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":222
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":223
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":225
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":217
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":227
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_13__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /*proto*/
static int __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_13__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_12__setitem__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0), ((PyObject *)__pyx_v_in_1));

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

static int __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_12__setitem__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_in_0);
  __Pyx_INCREF(__pyx_v_in_1);

  /* "pykeyvi.pyx":228
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":229
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":230
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":231
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":232
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):             # <<<<<<<<<<<<<<
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_in_1); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":233
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_1, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pykeyvi.pyx":234
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self,  in_0 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_convert_string_from_py_(__pyx_v_in_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->__setitem__(((std::string)__pyx_t_6), ((std::string)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":227
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XDECREF(__pyx_v_in_1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":236
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_14WriteToFile(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":237
 * 
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":238
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":239
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":240
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->WriteToFile(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":236
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.WriteToFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":242
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_16__enter__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pykeyvi.pyx":243
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":242
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":246
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,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_type)) != 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("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_18__exit__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pykeyvi.pyx":247
 * 
 *     def __exit__(self, type, value, traceback):
 *         self.Compile()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __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;

  /* "pykeyvi.pyx":246
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":250
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compile (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Compile", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_20Compile(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args) {
  void *__pyx_v_callback;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("Compile", 0);

  /* "pykeyvi.pyx":251
 * 
 *     def Compile(self, *args):
 *         if not args:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 self.inst.get().Compile()
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":252
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "pykeyvi.pyx":253
 *         if not args:
 *             with nogil:
 *                 self.inst.get().Compile()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
          __pyx_v_self->inst.get()->Compile();
        }

        /* "pykeyvi.pyx":252
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pykeyvi.pyx":254
 *             with nogil:
 *                 self.inst.get().Compile()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef void* callback = <void*> args[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":256
 *             return
 * 
 *         cdef void* callback = <void*> args[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)
 */
  __pyx_v_callback = ((void *)PyTuple_GET_ITEM(__pyx_v_args, 0));

  /* "pykeyvi.pyx":257
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "pykeyvi.pyx":258
 *         cdef void* callback = <void*> args[0]
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_self->inst.get()->Compile(__pyx_f_7pykeyvi_callback_wrapper, __pyx_v_callback);
      }

      /* "pykeyvi.pyx":257
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "pykeyvi.pyx":250
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

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

/* "pykeyvi.pyx":261
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_22JsonDictionaryCompiler_22SetManifest(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_22JsonDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":262
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":263
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * cdef class Dictionary:
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_m); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":261
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompiler.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":269
 *     cdef shared_ptr[_Dictionary] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_10Dictionary_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_10Dictionary_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_10Dictionary___dealloc__(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_10Dictionary___dealloc__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":270
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":269
 *     cdef shared_ptr[_Dictionary] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":273
 * 
 * 
 *     def LookupText(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_3LookupText(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_3LookupText(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("LookupText (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_2LookupText(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_2LookupText(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("LookupText", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":274
 * 
 *     def LookupText(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":275
 *     def LookupText(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":276
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":277
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->LookupText(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":278
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":279
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":280
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":281
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def Lookup(self,  in_0 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":273
 * 
 * 
 *     def LookupText(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary.LookupText", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":283
 *         return py_result
 * 
 *     def Lookup(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_5Lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_5Lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Lookup (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_4Lookup(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_4Lookup(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Lookup", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":284
 * 
 *     def Lookup(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":285
 *     def Lookup(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":286
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":287
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->Lookup(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":288
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":289
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":290
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":291
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def _GetNear_0(self,  in_0 ,  minimum_prefix_length ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":283
 *         return py_result
 * 
 *     def Lookup(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary.Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":293
 *         return py_result
 * 
 *     def _GetNear_0(self,  in_0 ,  minimum_prefix_length ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_7_GetNear_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_7_GetNear_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_minimum_prefix_length = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetNear_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_minimum_prefix_length,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minimum_prefix_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GetNear_0", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GetNear_0") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_minimum_prefix_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GetNear_0", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Dictionary._GetNear_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_6_GetNear_0(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_in_0, __pyx_v_minimum_prefix_length);

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_6_GetNear_0(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_minimum_prefix_length) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  size_t __pyx_t_7;
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetNear_0", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":294
 * 
 *     def _GetNear_0(self,  in_0 ,  minimum_prefix_length ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":295
 *     def _GetNear_0(self,  in_0 ,  minimum_prefix_length ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_minimum_prefix_length); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_minimum_prefix_length); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_minimum_prefix_length_wrong);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":296
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":297
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":299
 *             in_0 = in_0.encode('utf-8')
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_minimum_prefix_length); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_8 = __pyx_v_self->inst.get()->GetNear(((std::string)__pyx_t_6), ((size_t)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v__r = __pyx_t_8;

  /* "pykeyvi.pyx":300
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":301
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":302
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":303
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def _GetNear_1(self,  in_0 ,  minimum_prefix_length ,  greedy ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":293
 *         return py_result
 * 
 *     def _GetNear_0(self,  in_0 ,  minimum_prefix_length ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary._GetNear_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":305
 *         return py_result
 * 
 *     def _GetNear_1(self,  in_0 ,  minimum_prefix_length ,  greedy ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_9_GetNear_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_9_GetNear_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_minimum_prefix_length = 0;
  PyObject *__pyx_v_greedy = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetNear_1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_minimum_prefix_length,&__pyx_n_s_greedy,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minimum_prefix_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GetNear_1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_greedy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GetNear_1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GetNear_1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_minimum_prefix_length = values[1];
    __pyx_v_greedy = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GetNear_1", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Dictionary._GetNear_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_8_GetNear_1(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_in_0, __pyx_v_minimum_prefix_length, __pyx_v_greedy);

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_8_GetNear_1(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_minimum_prefix_length, PyObject *__pyx_v_greedy) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  size_t __pyx_t_7;
  bool __pyx_t_8;
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetNear_1", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":306
 * 
 *     def _GetNear_1(self,  in_0 ,  minimum_prefix_length ,  greedy ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":307
 *     def _GetNear_1(self,  in_0 ,  minimum_prefix_length ,  greedy ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_minimum_prefix_length); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_minimum_prefix_length); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_minimum_prefix_length_wrong);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":308
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_greedy); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L8_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_greedy); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_greedy_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":309
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":310
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pykeyvi.pyx":313
 * 
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length), (<bool>greedy))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_minimum_prefix_length); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_greedy); if (unlikely((__pyx_t_8 == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_9 = __pyx_v_self->inst.get()->GetNear(((std::string)__pyx_t_6), ((size_t)__pyx_t_7), ((bool)__pyx_t_8));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v__r = __pyx_t_9;

  /* "pykeyvi.pyx":314
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length), (<bool>greedy))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":315
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length), (<bool>greedy))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":316
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":317
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def GetNear(self, *args ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":305
 *         return py_result
 * 
 *     def _GetNear_1(self,  in_0 ,  minimum_prefix_length ,  greedy ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary._GetNear_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":319
 *         return py_result
 * 
 *     def GetNear(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetNear_0(*args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_11GetNear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_11GetNear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetNear (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "GetNear", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_10GetNear(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_10GetNear(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetNear", 0);

  /* "pykeyvi.pyx":320
 * 
 *     def GetNear(self, *args ):
 *         if (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):             # <<<<<<<<<<<<<<
 *             return self._GetNear_0(*args)
 *         elif (len(args)==3) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))) and (isinstance(args[2], (int, long))):
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_2 == 2) != 0);
  if (__pyx_t_3) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyBytes_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L8_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_L8_next_or:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L7_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  if (__pyx_t_5) {
    goto __pyx_L6_next_and;
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L6_next_and:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = PyInt_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L10_next_or;
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_L10_next_or:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyLong_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_5 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":321
 *     def GetNear(self, *args ):
 *         if (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetNear_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==3) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))) and (isinstance(args[2], (int, long))):
 *             return self._GetNear_1(*args)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetNear_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":322
 *         if (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetNear_0(*args)
 *         elif (len(args)==3) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))) and (isinstance(args[2], (int, long))):             # <<<<<<<<<<<<<<
 *             return self._GetNear_1(*args)
 *         else:
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_2 == 3) != 0);
  if (__pyx_t_3) {
    goto __pyx_L12_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = PyBytes_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L15_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_L15_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L14_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  if (__pyx_t_5) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyInt_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L18_next_or;
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_L18_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyLong_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L17_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_5 != 0);
  if (__pyx_t_3) {
    goto __pyx_L16_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L16_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 2);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = PyInt_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L20_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_L20_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 2);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyLong_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":323
 *             return self._GetNear_0(*args)
 *         elif (len(args)==3) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))) and (isinstance(args[2], (int, long))):
 *             return self._GetNear_1(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetNear_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pykeyvi.pyx":325
 *             return self._GetNear_1(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def _init_0(self,  filename ):
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":319
 *         return py_result
 * 
 *     def GetNear(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetNear_0(*args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pykeyvi.Dictionary.GetNear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":327
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def _init_0(self,  filename ):             # <<<<<<<<<<<<<<
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         if isinstance(filename, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_13_init_0(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_13_init_0(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_12_init_0(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_12_init_0(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  keyvi::dictionary::Dictionary *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);
  __Pyx_INCREF(__pyx_v_filename);

  /* "pykeyvi.pyx":328
 * 
 *     def _init_0(self,  filename ):
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_filename); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_filename); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_filename_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":329
 *     def _init_0(self,  filename ):
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         if isinstance(filename, unicode):             # <<<<<<<<<<<<<<
 *             filename = filename.encode('utf-8')
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_filename); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":330
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":331
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  filename , int in_1 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_filename); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_7 = new keyvi::dictionary::Dictionary(((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::Dictionary> (__pyx_t_7);

  /* "pykeyvi.pyx":327
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def _init_0(self,  filename ):             # <<<<<<<<<<<<<<
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         if isinstance(filename, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary._init_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":333
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))
 * 
 *     def _init_1(self,  filename , int in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_15_init_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_15_init_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  int __pyx_v_in_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_in_1,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_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_filename = values[0];
    __pyx_v_in_1 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_in_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Dictionary._init_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_14_init_1(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_filename, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_14_init_1(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_in_1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  keyvi::dictionary::Dictionary *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);
  __Pyx_INCREF(__pyx_v_filename);

  /* "pykeyvi.pyx":334
 * 
 *     def _init_1(self,  filename , int in_1 ):
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'             # <<<<<<<<<<<<<<
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 *         if isinstance(filename, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_filename); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_filename); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_filename_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":335
 *     def _init_1(self,  filename , int in_1 ):
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    switch (__pyx_v_in_1) {
      case 0:
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      __pyx_t_1 = 1;
      break;
      default:
      __pyx_t_1 = 0;
      break;
    }
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":336
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 *         if isinstance(filename, unicode):             # <<<<<<<<<<<<<<
 *             filename = filename.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_filename); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":337
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename), (<_loading_strategy_types>in_1)))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":339
 *             filename = filename.encode('utf-8')
 * 
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename), (<_loading_strategy_types>in_1)))             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_filename); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_7 = new keyvi::dictionary::Dictionary(((std::string)__pyx_t_6), ((keyvi::dictionary::loading_strategy_types)__pyx_v_in_1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::Dictionary> (__pyx_t_7);

  /* "pykeyvi.pyx":333
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))
 * 
 *     def _init_1(self,  filename , int in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary._init_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":341
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename), (<_loading_strategy_types>in_1)))
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_10Dictionary_17__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_10Dictionary_17__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_16__init__(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static int __pyx_pf_7pykeyvi_10Dictionary_16__init__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":342
 * 
 *     def __init__(self, *args , **kwargs):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (args[1] in [0, 1, 2, 3, 4, 5, 6, 7]):
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
  if (__pyx_t_3) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyBytes_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":343
 *     def __init__(self, *args , **kwargs):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (args[1] in [0, 1, 2, 3, 4, 5, 6, 7]):
 *              self._init_1(*args)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":344
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *              self._init_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (args[1] in [0, 1, 2, 3, 4, 5, 6, 7]):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         else:
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((__pyx_t_2 == 2) != 0);
  if (__pyx_t_5) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyBytes_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_5 != 0);
  if (__pyx_t_3) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_args, 1));
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L20_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L20_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L19_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L19_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L18_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L18_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L17_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L17_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L16_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L16_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L15_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L15_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_5) {
    goto __pyx_L14_next_or;
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L14_next_or:;
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_3 = __pyx_t_5;
  __pyx_L13_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":345
 *              self._init_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (args[1] in [0, 1, 2, 3, 4, 5, 6, 7]):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":347
 *              self._init_1(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def Get(self,  in_0 ):
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":341
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename), (<_loading_strategy_types>in_1)))
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pykeyvi.Dictionary.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":349
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Get(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_19Get(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_19Get(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Get (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_18Get(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_18Get(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Get", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":350
 * 
 *     def Get(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":351
 *     def Get(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":352
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":353
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->Get(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":354
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":355
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":356
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":357
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def get (self, key, default = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":349
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Get(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Dictionary.Get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":359
 *         return py_result
 * 
 *     def get (self, key, default = None):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_21get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_21get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Dictionary.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_20get(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), __pyx_v_key, __pyx_v_default);

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_20get(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
  boost::shared_ptr<keyvi::dictionary::Match>  __pyx_v__r;
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "pykeyvi.pyx":360
 * 
 *     def get (self, key, default = None):
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode('utf-8')
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":361
 *     def get (self, key, default = None):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":362
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_key); 
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":364
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 * 
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))             # <<<<<<<<<<<<<<
 * 
 *         if _r.get().IsEmpty():
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match(((*__pyx_v_self->inst.get())[((std::string)__pyx_t_5)])));

  /* "pykeyvi.pyx":366
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))
 * 
 *         if _r.get().IsEmpty():             # <<<<<<<<<<<<<<
 *             return default
 *         cdef Match py_result = Match.__new__(Match)
 */
  __pyx_t_2 = (__pyx_v__r.get()->IsEmpty() != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":367
 * 
 *         if _r.get().IsEmpty():
 *             return default             # <<<<<<<<<<<<<<
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_default);
    __pyx_r = __pyx_v_default;
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":368
 *         if _r.get().IsEmpty():
 *             return default
 *         cdef Match py_result = Match.__new__(Match)             # <<<<<<<<<<<<<<
 *         py_result.inst = _r
 *         return py_result
 */
  __pyx_t_4 = __pyx_tp_new_7pykeyvi_Match(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pykeyvi_Match)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pykeyvi.pyx":369
 *             return default
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->inst = __pyx_v__r;

  /* "pykeyvi.pyx":370
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":359
 *         return py_result
 * 
 *     def get (self, key, default = None):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.Dictionary.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":372
 *         return py_result
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_10Dictionary_23__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_7pykeyvi_10Dictionary_23__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_22__contains__(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static int __pyx_pf_7pykeyvi_10Dictionary_22__contains__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "pykeyvi.pyx":373
 * 
 *     def __contains__(self, key):
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":374
 *     def __contains__(self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":376
 *             key = key.encode('utf-8')
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 * 
 *         return self.inst.get().Contains(key)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_key); 
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":378
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 * 
 *         return self.inst.get().Contains(key)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_v_self->inst.get()->Contains(__pyx_t_5);
  goto __pyx_L0;

  /* "pykeyvi.pyx":372
 *         return py_result
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.Dictionary.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":380
 *         return self.inst.get().Contains(key)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.inst.get().GetSize()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pykeyvi_10Dictionary_25__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pykeyvi_10Dictionary_25__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_24__len__(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

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

  /* "pykeyvi.pyx":381
 * 
 *     def __len__(self):
 *         return self.inst.get().GetSize()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__ (self, key):
 */
  __pyx_r = __pyx_v_self->inst.get()->GetSize();
  goto __pyx_L0;

  /* "pykeyvi.pyx":380
 *         return self.inst.get().Contains(key)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.inst.get().GetSize()
 * 
 */

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

/* "pykeyvi.pyx":383
 *         return self.inst.get().GetSize()
 * 
 *     def __getitem__ (self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_26__getitem__(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_26__getitem__(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_key) {
  boost::shared_ptr<keyvi::dictionary::Match>  __pyx_v__r;
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "pykeyvi.pyx":384
 * 
 *     def __getitem__ (self, key):
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":385
 *     def __getitem__ (self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":387
 *             key = key.encode('utf-8')
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_key); 
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":389
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 * 
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))             # <<<<<<<<<<<<<<
 * 
 *         if _r.get().IsEmpty():
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match(((*__pyx_v_self->inst.get())[((std::string)__pyx_t_5)])));

  /* "pykeyvi.pyx":391
 *         cdef shared_ptr[_Match] _r = shared_ptr[_Match](new _Match(deref(self.inst.get())[(<libcpp_string>key)]))
 * 
 *         if _r.get().IsEmpty():             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 *         cdef Match py_result = Match.__new__(Match)
 */
  __pyx_t_2 = (__pyx_v__r.get()->IsEmpty() != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":392
 * 
 *         if _r.get().IsEmpty():
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":393
 *         if _r.get().IsEmpty():
 *             raise KeyError(key)
 *         cdef Match py_result = Match.__new__(Match)             # <<<<<<<<<<<<<<
 *         py_result.inst = _r
 *         return py_result
 */
  __pyx_t_3 = __pyx_tp_new_7pykeyvi_Match(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pykeyvi_Match)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pykeyvi.pyx":394
 *             raise KeyError(key)
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->inst = __pyx_v__r;

  /* "pykeyvi.pyx":395
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = _r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def _key_iterator_wrapper(self, iterator):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":383
 *         return self.inst.get().GetSize()
 * 
 *     def __getitem__ (self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.Dictionary.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_10Dictionary_30generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":397
 *         return py_result
 * 
 *     def _key_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetMatchedString()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_29_key_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_29_key_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_key_iterator_wrapper (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_28_key_iterator_wrapper(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_iterator));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_28_key_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_key_iterator_wrapper", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(__pyx_ptype_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_iterator = __pyx_v_iterator;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterator);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterator);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_10Dictionary_30generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_key_iterator_wrapper, __pyx_n_s_Dictionary__key_iterator_wrapper); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_10Dictionary_30generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pykeyvi.pyx":398
 * 
 *     def _key_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield m.GetMatchedString()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_iterator; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pykeyvi.pyx":399
 *     def _key_iterator_wrapper(self, iterator):
 *         for m in iterator:
 *             yield m.GetMatchedString()             # <<<<<<<<<<<<<<
 * 
 *     def _value_iterator_wrapper(self, iterator):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_m, __pyx_n_s_GetMatchedString); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pykeyvi.pyx":398
 * 
 *     def _key_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield m.GetMatchedString()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":397
 *         return py_result
 * 
 *     def _key_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetMatchedString()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_key_iterator_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_10Dictionary_33generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":401
 *             yield m.GetMatchedString()
 * 
 *     def _value_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetValue()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_32_value_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_32_value_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_value_iterator_wrapper (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_31_value_iterator_wrapper(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_iterator));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_31_value_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_value_iterator_wrapper", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(__pyx_ptype_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_iterator = __pyx_v_iterator;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterator);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterator);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_10Dictionary_33generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_value_iterator_wrapper, __pyx_n_s_Dictionary__value_iterator_wrapp); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_10Dictionary_33generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pykeyvi.pyx":402
 * 
 *     def _value_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield m.GetValue()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_iterator; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pykeyvi.pyx":403
 *     def _value_iterator_wrapper(self, iterator):
 *         for m in iterator:
 *             yield m.GetValue()             # <<<<<<<<<<<<<<
 * 
 *     def _item_iterator_wrapper(self, iterator):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_m, __pyx_n_s_GetValue); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pykeyvi.pyx":402
 * 
 *     def _value_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield m.GetValue()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":401
 *             yield m.GetMatchedString()
 * 
 *     def _value_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield m.GetValue()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_value_iterator_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_10Dictionary_36generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":405
 *             yield m.GetValue()
 * 
 *     def _item_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield (m.GetMatchedString(), m.GetValue())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_35_item_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_35_item_iterator_wrapper(PyObject *__pyx_v_self, PyObject *__pyx_v_iterator) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_item_iterator_wrapper (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_34_item_iterator_wrapper(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self), ((PyObject *)__pyx_v_iterator));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_34_item_iterator_wrapper(CYTHON_UNUSED struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self, PyObject *__pyx_v_iterator) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_item_iterator_wrapper", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(__pyx_ptype_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_iterator = __pyx_v_iterator;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterator);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterator);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_10Dictionary_36generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_item_iterator_wrapper, __pyx_n_s_Dictionary__item_iterator_wrappe); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_10Dictionary_36generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pykeyvi.pyx":406
 * 
 *     def _item_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield (m.GetMatchedString(), m.GetValue())
 * 
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_iterator)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_iterator; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pykeyvi.pyx":407
 *     def _item_iterator_wrapper(self, iterator):
 *         for m in iterator:
 *             yield (m.GetMatchedString(), m.GetValue())             # <<<<<<<<<<<<<<
 * 
 *     def GetAllKeys(self):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_m, __pyx_n_s_GetMatchedString); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_m, __pyx_n_s_GetValue); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pykeyvi.pyx":406
 * 
 *     def _item_iterator_wrapper(self, iterator):
 *         for m in iterator:             # <<<<<<<<<<<<<<
 *             yield (m.GetMatchedString(), m.GetValue())
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":405
 *             yield m.GetValue()
 * 
 *     def _item_iterator_wrapper(self, iterator):             # <<<<<<<<<<<<<<
 *         for m in iterator:
 *             yield (m.GetMatchedString(), m.GetValue())
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_item_iterator_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":409
 *             yield (m.GetMatchedString(), m.GetValue())
 * 
 *     def GetAllKeys(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_38GetAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_38GetAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetAllKeys (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_37GetAllKeys(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_37GetAllKeys(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetAllKeys", 0);

  /* "pykeyvi.pyx":410
 * 
 *     def GetAllKeys(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetAllItems();

  /* "pykeyvi.pyx":411
 *     def GetAllKeys(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_1 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":412
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return self._key_iterator_wrapper(py_result)
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":413
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return self._key_iterator_wrapper(py_result)
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":414
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return self._key_iterator_wrapper(py_result)             # <<<<<<<<<<<<<<
 * 
 *     def GetAllValues(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_key_iterator_wrapper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_py_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_py_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_py_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":409
 *             yield (m.GetMatchedString(), m.GetValue())
 * 
 *     def GetAllKeys(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

  /* function 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("pykeyvi.Dictionary.GetAllKeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":416
 *         return self._key_iterator_wrapper(py_result)
 * 
 *     def GetAllValues(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_40GetAllValues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_40GetAllValues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetAllValues (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_39GetAllValues(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_39GetAllValues(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetAllValues", 0);

  /* "pykeyvi.pyx":417
 * 
 *     def GetAllValues(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetAllItems();

  /* "pykeyvi.pyx":418
 *     def GetAllValues(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_1 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":419
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return self._value_iterator_wrapper(py_result)
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":420
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return self._value_iterator_wrapper(py_result)
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":421
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return self._value_iterator_wrapper(py_result)             # <<<<<<<<<<<<<<
 * 
 *     def GetAllItems(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_iterator_wrapper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_py_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_py_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_py_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":416
 *         return self._key_iterator_wrapper(py_result)
 * 
 *     def GetAllValues(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

  /* function 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("pykeyvi.Dictionary.GetAllValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":423
 *         return self._value_iterator_wrapper(py_result)
 * 
 *     def GetAllItems(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_42GetAllItems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_42GetAllItems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetAllItems (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_41GetAllItems(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_41GetAllItems(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetAllItems", 0);

  /* "pykeyvi.pyx":424
 * 
 *     def GetAllItems(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetAllItems();

  /* "pykeyvi.pyx":425
 *     def GetAllItems(self):
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_1 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":426
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return self._item_iterator_wrapper(py_result)
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":427
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return self._item_iterator_wrapper(py_result)
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":428
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return self._item_iterator_wrapper(py_result)             # <<<<<<<<<<<<<<
 * 
 *     def GetManifest(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_item_iterator_wrapper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_py_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_py_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_py_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":423
 *         return self._value_iterator_wrapper(py_result)
 * 
 *     def GetAllItems(self):             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetAllItems()
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */

  /* function 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("pykeyvi.Dictionary.GetAllItems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":430
 *         return self._item_iterator_wrapper(py_result)
 * 
 *     def GetManifest(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetManifestAsString()
 *         cdef bytes py_result = _r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_44GetManifest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_44GetManifest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_43GetManifest(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_43GetManifest(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  std::string __pyx_v__r;
  PyObject *__pyx_v_py_result = 0;
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetManifest", 0);

  /* "pykeyvi.pyx":431
 * 
 *     def GetManifest(self):
 *         cdef libcpp_string _r = self.inst.get().GetManifestAsString()             # <<<<<<<<<<<<<<
 *         cdef bytes py_result = _r
 *         import json
 */
  try {
    __pyx_t_1 = __pyx_v_self->inst.get()->GetManifestAsString();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v__r = __pyx_t_1;

  /* "pykeyvi.pyx":432
 *     def GetManifest(self):
 *         cdef libcpp_string _r = self.inst.get().GetManifestAsString()
 *         cdef bytes py_result = _r             # <<<<<<<<<<<<<<
 *         import json
 *         return json.loads(py_result)
 */
  __pyx_t_2 = __pyx_convert_string_to_py_(__pyx_v__r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_py_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pykeyvi.pyx":433
 *         cdef libcpp_string _r = self.inst.get().GetManifestAsString()
 *         cdef bytes py_result = _r
 *         import json             # <<<<<<<<<<<<<<
 *         return json.loads(py_result)
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_json = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pykeyvi.pyx":434
 *         cdef bytes py_result = _r
 *         import json
 *         return json.loads(py_result)             # <<<<<<<<<<<<<<
 * 
 *     def GetStatistics(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_py_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_py_result);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_py_result);
    __Pyx_GIVEREF(__pyx_v_py_result);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":430
 *         return self._item_iterator_wrapper(py_result)
 * 
 *     def GetManifest(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetManifestAsString()
 *         cdef bytes py_result = _r
 */

  /* 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_AddTraceback("pykeyvi.Dictionary.GetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":436
 *         return json.loads(py_result)
 * 
 *     def GetStatistics(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()
 *         cdef bytes py_result = _r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_46GetStatistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_46GetStatistics(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetStatistics (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_10Dictionary_45GetStatistics(((struct __pyx_obj_7pykeyvi_Dictionary *)__pyx_v_self));

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

/* "pykeyvi.pyx":441
 *         import json
 *         return {k: json.loads(v) for k, v in filter(
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],             # <<<<<<<<<<<<<<
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]
 *         )}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_13GetStatistics_7genexpr_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_kv); /*proto*/
static PyMethodDef __pyx_mdef_7pykeyvi_10Dictionary_13GetStatistics_7genexpr_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_13GetStatistics_7genexpr_lambda1, METH_O, 0};
static PyObject *__pyx_pw_7pykeyvi_10Dictionary_13GetStatistics_7genexpr_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_kv) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_kv));

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

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kv) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kv); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    goto __pyx_L4_next_and;
  } else {
    __Pyx_INCREF(__pyx_v_kv);
    __pyx_t_1 = __pyx_v_kv;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_L4_next_and:;
  __pyx_t_2 = PyList_Check(__pyx_v_kv); 
  if (__pyx_t_2) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = PyObject_Length(__pyx_v_kv); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_4 > 1);
  if (__pyx_t_2) {
    goto __pyx_L6_next_and;
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_L6_next_and:;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_kv, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pykeyvi.pyx":436
 *         return json.loads(py_result)
 * 
 *     def GetStatistics(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()
 *         cdef bytes py_result = _r
 */

static PyObject *__pyx_pf_7pykeyvi_10Dictionary_45GetStatistics(struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_self) {
  std::string __pyx_v__r;
  PyObject *__pyx_v_py_result = 0;
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetStatistics", 0);

  /* "pykeyvi.pyx":437
 * 
 *     def GetStatistics(self):
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()             # <<<<<<<<<<<<<<
 *         cdef bytes py_result = _r
 *         import json
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetStatistics();

  /* "pykeyvi.pyx":438
 *     def GetStatistics(self):
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()
 *         cdef bytes py_result = _r             # <<<<<<<<<<<<<<
 *         import json
 *         return {k: json.loads(v) for k, v in filter(
 */
  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v__r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_py_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":439
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()
 *         cdef bytes py_result = _r
 *         import json             # <<<<<<<<<<<<<<
 *         return {k: json.loads(v) for k, v in filter(
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":440
 *         cdef bytes py_result = _r
 *         import json
 *         return {k: json.loads(v) for k, v in filter(             # <<<<<<<<<<<<<<
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    PyObject *__pyx_7genexpr__pyx_v_k = NULL;
    PyObject *__pyx_7genexpr__pyx_v_v = NULL;
    PyObject *__pyx_7genexpr__pyx_v_s = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "pykeyvi.pyx":441
 *         import json
 *         return {k: json.loads(v) for k, v in filter(
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],             # <<<<<<<<<<<<<<
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]
 *         )}
 */
    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pykeyvi_10Dictionary_13GetStatistics_7genexpr_lambda1, 0, __pyx_n_s_GetStatistics_locals_lambda, NULL, __pyx_n_s_pykeyvi, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "pykeyvi.pyx":442
 *         return {k: json.loads(v) for k, v in filter(
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]             # <<<<<<<<<<<<<<
 *         )}
 * 
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_result, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_s, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pykeyvi.pyx":440
 *         cdef bytes py_result = _r
 *         import json
 *         return {k: json.loads(v) for k, v in filter(             # <<<<<<<<<<<<<<
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_unpacking_done;
        __pyx_L10_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_L11_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_7genexpr__pyx_v_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_7genexpr__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_7genexpr__pyx_v_v);
        __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_v);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s);
    goto __pyx_L12_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s);
    goto __pyx_L1_error;
    __pyx_L12_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":436
 *         return json.loads(py_result)
 * 
 *     def GetStatistics(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetStatistics()
 *         cdef bytes py_result = _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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pykeyvi.Dictionary.GetStatistics", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":449
 *     cdef shared_ptr[_FsaTransform] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_12FsaTransform_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_12FsaTransform_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_12FsaTransform___dealloc__(((struct __pyx_obj_7pykeyvi_FsaTransform *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_12FsaTransform___dealloc__(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":450
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":449
 *     cdef shared_ptr[_FsaTransform] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":453
 * 
 * 
 *     def Normalize(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_12FsaTransform_3Normalize(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_12FsaTransform_3Normalize(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Normalize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_12FsaTransform_2Normalize(((struct __pyx_obj_7pykeyvi_FsaTransform *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_12FsaTransform_2Normalize(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self, PyObject *__pyx_v_in_0) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Normalize", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":454
 * 
 *     def Normalize(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":455
 *     def Normalize(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":456
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":457
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->Normalize(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":458
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":459
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Dictionary in_0 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":453
 * 
 * 
 *     def Normalize(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.FsaTransform.Normalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":461
 *         return py_result
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_12FsaTransform_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_12FsaTransform_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_in_0 = ((struct __pyx_obj_7pykeyvi_Dictionary *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.FsaTransform.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), __pyx_ptype_7pykeyvi_Dictionary, 1, "in_0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_12FsaTransform_4__init__(((struct __pyx_obj_7pykeyvi_FsaTransform *)__pyx_v_self), __pyx_v_in_0);

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

static int __pyx_pf_7pykeyvi_12FsaTransform_4__init__(struct __pyx_obj_7pykeyvi_FsaTransform *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0) {
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_v_input_in_0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_t_2;
  keyvi::transform::FsaTransform *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":462
 * 
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_FsaTransform](new _FsaTransform(input_in_0))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_in_0), ((PyObject*)__pyx_ptype_7pykeyvi_Dictionary)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":463
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_FsaTransform](new _FsaTransform(input_in_0))
 * 
 */
  __pyx_t_2 = __pyx_v_in_0->inst;
  __pyx_v_input_in_0 = __pyx_t_2;

  /* "pykeyvi.pyx":464
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_FsaTransform](new _FsaTransform(input_in_0))             # <<<<<<<<<<<<<<
 * 
 * cdef class PrefixCompletion:
 */
  try {
    __pyx_t_3 = new keyvi::transform::FsaTransform(__pyx_v_input_in_0);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::transform::FsaTransform> (__pyx_t_3);

  /* "pykeyvi.pyx":461
 *         return py_result
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.FsaTransform.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":470
 *     cdef shared_ptr[_PrefixCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_16PrefixCompletion_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_16PrefixCompletion_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_16PrefixCompletion___dealloc__(((struct __pyx_obj_7pykeyvi_PrefixCompletion *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_16PrefixCompletion___dealloc__(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":471
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":470
 *     cdef shared_ptr[_PrefixCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":474
 * 
 * 
 *     def GetFuzzyCompletions(self,  in_0 ,  max_edit_distance ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_16PrefixCompletion_3GetFuzzyCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_16PrefixCompletion_3GetFuzzyCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_max_edit_distance = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetFuzzyCompletions (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_max_edit_distance,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_edit_distance)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("GetFuzzyCompletions", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "GetFuzzyCompletions") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_max_edit_distance = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("GetFuzzyCompletions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.PrefixCompletion.GetFuzzyCompletions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_16PrefixCompletion_2GetFuzzyCompletions(((struct __pyx_obj_7pykeyvi_PrefixCompletion *)__pyx_v_self), __pyx_v_in_0, __pyx_v_max_edit_distance);

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

static PyObject *__pyx_pf_7pykeyvi_16PrefixCompletion_2GetFuzzyCompletions(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_max_edit_distance) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetFuzzyCompletions", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":475
 * 
 *     def GetFuzzyCompletions(self,  in_0 ,  max_edit_distance ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":476
 *     def GetFuzzyCompletions(self,  in_0 ,  max_edit_distance ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_max_edit_distance); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_max_edit_distance); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_max_edit_distance_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":477
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":478
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetFuzzyCompletions((<libcpp_string>in_0), (<int>max_edit_distance))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":480
 *             in_0 = in_0.encode('utf-8')
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetFuzzyCompletions((<libcpp_string>in_0), (<int>max_edit_distance))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_max_edit_distance); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetFuzzyCompletions(((std::string)__pyx_t_6), ((int)__pyx_t_7));

  /* "pykeyvi.pyx":481
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetFuzzyCompletions((<libcpp_string>in_0), (<int>max_edit_distance))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":482
 *         cdef _MatchIteratorPair _r = self.inst.get().GetFuzzyCompletions((<libcpp_string>in_0), (<int>max_edit_distance))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":483
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":484
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Dictionary in_0 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":474
 * 
 * 
 *     def GetFuzzyCompletions(self,  in_0 ,  max_edit_distance ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.PrefixCompletion.GetFuzzyCompletions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":486
 *         return py_result
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_16PrefixCompletion_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_16PrefixCompletion_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_in_0 = ((struct __pyx_obj_7pykeyvi_Dictionary *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.PrefixCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), __pyx_ptype_7pykeyvi_Dictionary, 1, "in_0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_16PrefixCompletion_4__init__(((struct __pyx_obj_7pykeyvi_PrefixCompletion *)__pyx_v_self), __pyx_v_in_0);

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

static int __pyx_pf_7pykeyvi_16PrefixCompletion_4__init__(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0) {
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_v_input_in_0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_t_2;
  keyvi::dictionary::completion::PrefixCompletion *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":487
 * 
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_PrefixCompletion](new _PrefixCompletion(input_in_0))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_in_0), ((PyObject*)__pyx_ptype_7pykeyvi_Dictionary)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":488
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_PrefixCompletion](new _PrefixCompletion(input_in_0))
 * 
 */
  __pyx_t_2 = __pyx_v_in_0->inst;
  __pyx_v_input_in_0 = __pyx_t_2;

  /* "pykeyvi.pyx":489
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_PrefixCompletion](new _PrefixCompletion(input_in_0))             # <<<<<<<<<<<<<<
 * 
 *     def GetCompletions(self,  in_0 ):
 */
  try {
    __pyx_t_3 = new keyvi::dictionary::completion::PrefixCompletion(__pyx_v_input_in_0);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::completion::PrefixCompletion> (__pyx_t_3);

  /* "pykeyvi.pyx":486
 *         return py_result
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.PrefixCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":491
 *         self.inst = shared_ptr[_PrefixCompletion](new _PrefixCompletion(input_in_0))
 * 
 *     def GetCompletions(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_16PrefixCompletion_7GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_16PrefixCompletion_7GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetCompletions (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_16PrefixCompletion_6GetCompletions(((struct __pyx_obj_7pykeyvi_PrefixCompletion *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_16PrefixCompletion_6GetCompletions(struct __pyx_obj_7pykeyvi_PrefixCompletion *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetCompletions", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":492
 * 
 *     def GetCompletions(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":493
 *     def GetCompletions(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":494
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":495
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetCompletions(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":496
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":497
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":498
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":499
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 * cdef class ForwardBackwardCompletion:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":491
 *         self.inst = shared_ptr[_PrefixCompletion](new _PrefixCompletion(input_in_0))
 * 
 *     def GetCompletions(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.PrefixCompletion.GetCompletions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":505
 *     cdef shared_ptr[_ForwardBackwardCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_25ForwardBackwardCompletion_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_25ForwardBackwardCompletion_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_25ForwardBackwardCompletion___dealloc__(((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_25ForwardBackwardCompletion___dealloc__(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":506
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":505
 *     cdef shared_ptr[_ForwardBackwardCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":509
 * 
 * 
 *     def _GetCompletions_0(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_3_GetCompletions_0(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_3_GetCompletions_0(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetCompletions_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_2_GetCompletions_0(((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_2_GetCompletions_0(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetCompletions_0", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":510
 * 
 *     def _GetCompletions_0(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":511
 *     def _GetCompletions_0(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":512
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":513
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetCompletions(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":514
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":515
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":516
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":517
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":509
 * 
 * 
 *     def _GetCompletions_0(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion._GetCompletions_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":519
 *         return py_result
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_5_GetCompletions_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_5_GetCompletions_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetCompletions_1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GetCompletions_1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GetCompletions_1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GetCompletions_1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion._GetCompletions_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_4_GetCompletions_1(((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_4_GetCompletions_1(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetCompletions_1", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":520
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":521
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":522
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":523
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":525
 *             in_0 = in_0.encode('utf-8')
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_in_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetCompletions(((std::string)__pyx_t_6), ((int)__pyx_t_7));

  /* "pykeyvi.pyx":526
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":527
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":528
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":529
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def GetCompletions(self, *args ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":519
 *         return py_result
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion._GetCompletions_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":531
 *         return py_result
 * 
 *     def GetCompletions(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_7GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_7GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetCompletions (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "GetCompletions", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_6GetCompletions(((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_25ForwardBackwardCompletion_6GetCompletions(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetCompletions", 0);

  /* "pykeyvi.pyx":532
 * 
 *     def GetCompletions(self, *args ):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):             # <<<<<<<<<<<<<<
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
  if (__pyx_t_3) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyBytes_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":533
 *     def GetCompletions(self, *args ):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetCompletions_1(*args)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetCompletions_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":534
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):             # <<<<<<<<<<<<<<
 *             return self._GetCompletions_1(*args)
 *         else:
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((__pyx_t_2 == 2) != 0);
  if (__pyx_t_5) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyBytes_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_5 != 0);
  if (__pyx_t_3) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = PyInt_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L14_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L14_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyLong_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L13_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":535
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetCompletions_1(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetCompletions_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pykeyvi.pyx":537
 *             return self._GetCompletions_1(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Dictionary in_0 , Dictionary in_1 ):
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":531
 *         return py_result
 * 
 *     def GetCompletions(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion.GetCompletions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":539
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def __init__(self, Dictionary in_0 , Dictionary in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_25ForwardBackwardCompletion_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_25ForwardBackwardCompletion_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0 = 0;
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = ((struct __pyx_obj_7pykeyvi_Dictionary *)values[0]);
    __pyx_v_in_1 = ((struct __pyx_obj_7pykeyvi_Dictionary *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), __pyx_ptype_7pykeyvi_Dictionary, 1, "in_0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_1), __pyx_ptype_7pykeyvi_Dictionary, 1, "in_1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_8__init__(((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static int __pyx_pf_7pykeyvi_25ForwardBackwardCompletion_8__init__(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_1) {
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_v_input_in_0;
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_v_input_in_1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_t_2;
  keyvi::dictionary::completion::ForwardBackwardCompletion *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":540
 * 
 *     def __init__(self, Dictionary in_0 , Dictionary in_1 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_in_0), ((PyObject*)__pyx_ptype_7pykeyvi_Dictionary)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":541
 *     def __init__(self, Dictionary in_0 , Dictionary in_1 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         cdef shared_ptr[_Dictionary] input_in_1 = in_1.inst
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_in_1), ((PyObject*)__pyx_ptype_7pykeyvi_Dictionary)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":542
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[_Dictionary] input_in_1 = in_1.inst
 *         self.inst = shared_ptr[_ForwardBackwardCompletion](new _ForwardBackwardCompletion(input_in_0, input_in_1))
 */
  __pyx_t_2 = __pyx_v_in_0->inst;
  __pyx_v_input_in_0 = __pyx_t_2;

  /* "pykeyvi.pyx":543
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         cdef shared_ptr[_Dictionary] input_in_1 = in_1.inst             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_ForwardBackwardCompletion](new _ForwardBackwardCompletion(input_in_0, input_in_1))
 * 
 */
  __pyx_t_2 = __pyx_v_in_1->inst;
  __pyx_v_input_in_1 = __pyx_t_2;

  /* "pykeyvi.pyx":544
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         cdef shared_ptr[_Dictionary] input_in_1 = in_1.inst
 *         self.inst = shared_ptr[_ForwardBackwardCompletion](new _ForwardBackwardCompletion(input_in_0, input_in_1))             # <<<<<<<<<<<<<<
 * 
 * cdef class loading_strategy_types:
 */
  try {
    __pyx_t_3 = new keyvi::dictionary::completion::ForwardBackwardCompletion(__pyx_v_input_in_0, __pyx_v_input_in_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::completion::ForwardBackwardCompletion> (__pyx_t_3);

  /* "pykeyvi.pyx":539
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def __init__(self, Dictionary in_0 , Dictionary in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         assert isinstance(in_1, Dictionary), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.ForwardBackwardCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":560
 *     cdef shared_ptr[_JsonDictionaryCompilerSmallData] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData___dealloc__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData___dealloc__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":561
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":560
 *     cdef shared_ptr[_JsonDictionaryCompilerSmallData] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":564
 * 
 * 
 *     def __setitem__(self, bytes in_0 , bytes in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         assert isinstance(in_1, bytes), 'arg in_1 wrong type'
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /*proto*/
static int __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), (&PyBytes_Type), 1, "in_0", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_1), (&PyBytes_Type), 1, "in_1", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_2__setitem__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), ((PyObject*)__pyx_v_in_0), ((PyObject*)__pyx_v_in_1));

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

static int __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_2__setitem__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  std::string __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "pykeyvi.pyx":565
 * 
 *     def __setitem__(self, bytes in_0 , bytes in_1 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, bytes), 'arg in_1 wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_0); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":566
 *     def __setitem__(self, bytes in_0 , bytes in_1 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         assert isinstance(in_1, bytes), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_1); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":569
 * 
 * 
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def _init_0(self):
 */
  __pyx_t_2 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __pyx_convert_string_from_py_(__pyx_v_in_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->__setitem__(((std::string)__pyx_t_2), ((std::string)__pyx_t_3));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":564
 * 
 * 
 *     def __setitem__(self, bytes in_0 , bytes in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         assert isinstance(in_1, bytes), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":571
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_5_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_5_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_4_init_0(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_4_init_0(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::JsonDictionaryCompilerSmallData *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":572
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::JsonDictionaryCompilerSmallData();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompilerSmallData> (__pyx_t_1);

  /* "pykeyvi.pyx":571
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData())
 * 
 */

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

/* "pykeyvi.pyx":574
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_6_init_1(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_6_init_1(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::JsonDictionaryCompilerSmallData *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":575
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":577
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::JsonDictionaryCompilerSmallData(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompilerSmallData> (__pyx_t_5);

  /* "pykeyvi.pyx":574
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":579
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_9_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_9_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8_init_2(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":581
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_22_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_2generator15, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_5generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_23_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_23_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_5generator16, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_5generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":579
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8_init_2(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::JsonDictionaryCompilerSmallData *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_21__init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct_21__init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":580
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":581
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":583
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":584
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":585
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":584
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":586
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::JsonDictionaryCompilerSmallData(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompilerSmallData> (__pyx_t_16);

  /* "pykeyvi.pyx":587
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":579
 *         self.inst = shared_ptr[_JsonDictionaryCompilerSmallData](new _JsonDictionaryCompilerSmallData((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":589
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_11__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_10__init__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":594
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_25_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___2generator17, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___5generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_26_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_26_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___5generator18, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___5generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":589
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_10__init__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_24___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_24___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":590
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":591
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":592
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":593
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":594
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":595
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":597
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self, bytes in_0 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":589
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":599
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_13WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_13WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), (&PyBytes_Type), 1, "in_0", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_12WriteToFile(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), ((PyObject*)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_12WriteToFile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);

  /* "pykeyvi.pyx":600
 * 
 *     def WriteToFile(self, bytes in_0 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_0); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":602
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 * 
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_2 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->WriteToFile(((std::string)__pyx_t_2));

  /* "pykeyvi.pyx":599
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 * 
 */

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

/* "pykeyvi.pyx":604
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_14__enter__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_14__enter__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pykeyvi.pyx":605
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":604
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":608
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,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_type)) != 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("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_16__exit__(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_16__exit__(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pykeyvi.pyx":609
 * 
 *     def __exit__(self, type, value, traceback):
 *         self.Compile()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __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;

  /* "pykeyvi.pyx":608
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":612
 * 
 * 
 *     def Add(self, key , value ):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(value, (bytes, unicode)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_19Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_19Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (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("Add", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_18Add(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_18Add(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  std::string __pyx_v_input_in_0;
  std::string __pyx_v_input_in_1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);

  /* "pykeyvi.pyx":613
 * 
 *     def Add(self, key , value ):
 *         assert isinstance(key, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value, (bytes, unicode)), 'arg in_1 wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_key); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_key); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":614
 *     def Add(self, key , value ):
 *         assert isinstance(key, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(value, (bytes, unicode)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_value); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_value); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":616
 *         assert isinstance(value, (bytes, unicode)), 'arg in_1 wrong type'
 * 
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode('UTF-8')
 *         cdef libcpp_string input_in_0 = <libcpp_string> key
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":617
 * 
 *         if isinstance(key, unicode):
 *             key = key.encode('UTF-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string input_in_0 = <libcpp_string> key
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":618
 *         if isinstance(key, unicode):
 *             key = key.encode('UTF-8')
 *         cdef libcpp_string input_in_0 = <libcpp_string> key             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(value, unicode):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_in_0 = ((std::string)__pyx_t_6);

  /* "pykeyvi.pyx":620
 *         cdef libcpp_string input_in_0 = <libcpp_string> key
 * 
 *         if isinstance(value, unicode):             # <<<<<<<<<<<<<<
 *             value = value.encode('UTF-8')
 *         cdef libcpp_string input_in_1 = <libcpp_string> value
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":621
 * 
 *         if isinstance(value, unicode):
 *             value = value.encode('UTF-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string input_in_1 = <libcpp_string> value
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pykeyvi.pyx":622
 *         if isinstance(value, unicode):
 *             value = value.encode('UTF-8')
 *         cdef libcpp_string input_in_1 = <libcpp_string> value             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().Add(input_in_0, input_in_1)
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_in_1 = ((std::string)__pyx_t_6);

  /* "pykeyvi.pyx":624
 *         cdef libcpp_string input_in_1 = <libcpp_string> value
 * 
 *         self.inst.get().Add(input_in_0, input_in_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_v_self->inst.get()->Add(__pyx_v_input_in_0, __pyx_v_input_in_1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":612
 * 
 * 
 *     def Add(self, key , value ):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(value, (bytes, unicode)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":627
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compile (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Compile", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_20Compile(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_20Compile(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_args) {
  void *__pyx_v_callback;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("Compile", 0);

  /* "pykeyvi.pyx":628
 * 
 *     def Compile(self, *args):
 *         if not args:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 self.inst.get().Compile()
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":629
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "pykeyvi.pyx":630
 *         if not args:
 *             with nogil:
 *                 self.inst.get().Compile()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
          __pyx_v_self->inst.get()->Compile();
        }

        /* "pykeyvi.pyx":629
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pykeyvi.pyx":631
 *             with nogil:
 *                 self.inst.get().Compile()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef void* callback = <void*> args[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":633
 *             return
 * 
 *         cdef void* callback = <void*> args[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)
 */
  __pyx_v_callback = ((void *)PyTuple_GET_ITEM(__pyx_v_args, 0));

  /* "pykeyvi.pyx":634
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "pykeyvi.pyx":635
 *         cdef void* callback = <void*> args[0]
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_self->inst.get()->Compile(__pyx_f_7pykeyvi_callback_wrapper, __pyx_v_callback);
      }

      /* "pykeyvi.pyx":634
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "pykeyvi.pyx":627
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

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

/* "pykeyvi.pyx":638
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_22SetManifest(((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_31JsonDictionaryCompilerSmallData_22SetManifest(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":639
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":640
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * cdef class MultiWordCompletion:
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_m); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":638
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.JsonDictionaryCompilerSmallData.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":646
 *     cdef shared_ptr[_MultiWordCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_19MultiWordCompletion_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_19MultiWordCompletion_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_19MultiWordCompletion___dealloc__(((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_19MultiWordCompletion___dealloc__(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":647
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":646
 *     cdef shared_ptr[_MultiWordCompletion] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":650
 * 
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_19MultiWordCompletion_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_19MultiWordCompletion_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_in_0 = ((struct __pyx_obj_7pykeyvi_Dictionary *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), __pyx_ptype_7pykeyvi_Dictionary, 1, "in_0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_19MultiWordCompletion_2__init__(((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)__pyx_v_self), __pyx_v_in_0);

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

static int __pyx_pf_7pykeyvi_19MultiWordCompletion_2__init__(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, struct __pyx_obj_7pykeyvi_Dictionary *__pyx_v_in_0) {
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_v_input_in_0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  boost::shared_ptr<keyvi::dictionary::Dictionary>  __pyx_t_2;
  keyvi::dictionary::completion::MultiWordCompletion *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":651
 * 
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_MultiWordCompletion](new _MultiWordCompletion(input_in_0))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_in_0), ((PyObject*)__pyx_ptype_7pykeyvi_Dictionary)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":652
 *     def __init__(self, Dictionary in_0 ):
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_MultiWordCompletion](new _MultiWordCompletion(input_in_0))
 * 
 */
  __pyx_t_2 = __pyx_v_in_0->inst;
  __pyx_v_input_in_0 = __pyx_t_2;

  /* "pykeyvi.pyx":653
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 *         self.inst = shared_ptr[_MultiWordCompletion](new _MultiWordCompletion(input_in_0))             # <<<<<<<<<<<<<<
 * 
 *     def _GetCompletions_0(self,  in_0 ):
 */
  try {
    __pyx_t_3 = new keyvi::dictionary::completion::MultiWordCompletion(__pyx_v_input_in_0);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::completion::MultiWordCompletion> (__pyx_t_3);

  /* "pykeyvi.pyx":650
 * 
 * 
 *     def __init__(self, Dictionary in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, Dictionary), 'arg in_0 wrong type'
 *         cdef shared_ptr[_Dictionary] input_in_0 = in_0.inst
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":655
 *         self.inst = shared_ptr[_MultiWordCompletion](new _MultiWordCompletion(input_in_0))
 * 
 *     def _GetCompletions_0(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_5_GetCompletions_0(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_5_GetCompletions_0(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetCompletions_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_19MultiWordCompletion_4_GetCompletions_0(((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_4_GetCompletions_0(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_in_0) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetCompletions_0", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":656
 * 
 *     def _GetCompletions_0(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":657
 *     def _GetCompletions_0(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":658
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":659
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetCompletions(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":660
 *             in_0 = in_0.encode('utf-8')
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":661
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":662
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":663
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":655
 *         self.inst = shared_ptr[_MultiWordCompletion](new _MultiWordCompletion(input_in_0))
 * 
 *     def _GetCompletions_0(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion._GetCompletions_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":665
 *         return py_result
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_7_GetCompletions_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_7_GetCompletions_1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_GetCompletions_1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_GetCompletions_1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_GetCompletions_1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_GetCompletions_1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion._GetCompletions_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_19MultiWordCompletion_6_GetCompletions_1(((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_6_GetCompletions_1(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  keyvi::dictionary::MatchIterator::MatchIteratorPair __pyx_v__r;
  struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_GetCompletions_1", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":666
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":667
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":668
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":669
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":671
 *             in_0 = in_0.encode('utf-8')
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))             # <<<<<<<<<<<<<<
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_in_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->GetCompletions(((std::string)__pyx_t_6), ((int)__pyx_t_7));

  /* "pykeyvi.pyx":672
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)             # <<<<<<<<<<<<<<
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 */
  __pyx_t_5 = __pyx_tp_new_7pykeyvi_MatchIterator(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_MatchIterator)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pykeyvi_MatchIterator)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pykeyvi.pyx":673
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()             # <<<<<<<<<<<<<<
 *         py_result.end = _r.end()
 *         return py_result
 */
  __pyx_v_py_result->it = __pyx_v__r.begin();

  /* "pykeyvi.pyx":674
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result->end = __pyx_v__r.end();

  /* "pykeyvi.pyx":675
 *         py_result.it = _r.begin()
 *         py_result.end = _r.end()
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def GetCompletions(self, *args ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":665
 *         return py_result
 * 
 *     def _GetCompletions_1(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion._GetCompletions_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_result);
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":677
 *         return py_result
 * 
 *     def GetCompletions(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_9GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_19MultiWordCompletion_9GetCompletions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetCompletions (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "GetCompletions", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_19MultiWordCompletion_8GetCompletions(((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_19MultiWordCompletion_8GetCompletions(struct __pyx_obj_7pykeyvi_MultiWordCompletion *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetCompletions", 0);

  /* "pykeyvi.pyx":678
 * 
 *     def GetCompletions(self, *args ):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):             # <<<<<<<<<<<<<<
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
  if (__pyx_t_3) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyBytes_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":679
 *     def GetCompletions(self, *args ):
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetCompletions_1(*args)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetCompletions_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":680
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):             # <<<<<<<<<<<<<<
 *             return self._GetCompletions_1(*args)
 *         else:
 */
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((__pyx_t_2 == 2) != 0);
  if (__pyx_t_5) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_3 = PyBytes_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyUnicode_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_5 != 0);
  if (__pyx_t_3) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_5 = PyInt_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L14_next_or;
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_L14_next_or:;
  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_6 = PyLong_Check(__pyx_t_8); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L13_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":681
 *             return self._GetCompletions_0(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (bytes, unicode))) and (isinstance(args[1], (int, long))):
 *             return self._GetCompletions_1(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_GetCompletions_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pykeyvi.pyx":683
 *             return self._GetCompletions_1(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 * cdef class PredictiveCompression:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":677
 *         return py_result
 * 
 *     def GetCompletions(self, *args ):             # <<<<<<<<<<<<<<
 *         if (len(args)==1) and (isinstance(args[0], (bytes, unicode))):
 *             return self._GetCompletions_0(*args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pykeyvi.MultiWordCompletion.GetCompletions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":689
 *     cdef shared_ptr[_PredictiveCompression] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_21PredictiveCompression_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_21PredictiveCompression_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_21PredictiveCompression___dealloc__(((struct __pyx_obj_7pykeyvi_PredictiveCompression *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_21PredictiveCompression___dealloc__(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":690
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":689
 *     cdef shared_ptr[_PredictiveCompression] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":693
 * 
 * 
 *     def Compress(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_21PredictiveCompression_3Compress(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_21PredictiveCompression_3Compress(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compress (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_21PredictiveCompression_2Compress(((struct __pyx_obj_7pykeyvi_PredictiveCompression *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_21PredictiveCompression_2Compress(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Compress", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":694
 * 
 *     def Compress(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":695
 *     def Compress(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":696
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":697
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->Compress(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":698
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":699
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self,  in_0 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":693
 * 
 * 
 *     def Compress(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.PredictiveCompression.Compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":701
 *         return py_result
 * 
 *     def __init__(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_21PredictiveCompression_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_21PredictiveCompression_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_in_0 = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.PredictiveCompression.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_21PredictiveCompression_4__init__(((struct __pyx_obj_7pykeyvi_PredictiveCompression *)__pyx_v_self), __pyx_v_in_0);

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

static int __pyx_pf_7pykeyvi_21PredictiveCompression_4__init__(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  keyvi::compression::PredictiveCompression *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":702
 * 
 *     def __init__(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":703
 *     def __init__(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":704
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":705
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))             # <<<<<<<<<<<<<<
 * 
 *     def Uncompress(self,  in_0 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_7 = new keyvi::compression::PredictiveCompression(((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::compression::PredictiveCompression> (__pyx_t_7);

  /* "pykeyvi.pyx":701
 *         return py_result
 * 
 *     def __init__(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.PredictiveCompression.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":707
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))
 * 
 *     def Uncompress(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_21PredictiveCompression_7Uncompress(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_21PredictiveCompression_7Uncompress(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Uncompress (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_21PredictiveCompression_6Uncompress(((struct __pyx_obj_7pykeyvi_PredictiveCompression *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_21PredictiveCompression_6Uncompress(struct __pyx_obj_7pykeyvi_PredictiveCompression *__pyx_v_self, PyObject *__pyx_v_in_0) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Uncompress", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":708
 * 
 *     def Uncompress(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":709
 *     def Uncompress(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":710
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":711
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__r = __pyx_v_self->inst.get()->Uncompress(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":712
 *             in_0 = in_0.encode('utf-8')
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":713
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 * cdef class KeyOnlyDictionaryGenerator:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":707
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))
 * 
 *     def Uncompress(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.PredictiveCompression.Uncompress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":719
 *     cdef shared_ptr[_KeyOnlyDictionaryGenerator] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator___dealloc__(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator___dealloc__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":720
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":719
 *     cdef shared_ptr[_KeyOnlyDictionaryGenerator] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":723
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_KeyOnlyDictionaryGenerator](new _KeyOnlyDictionaryGenerator())
 * 
 */

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

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

static int __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_2__init__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::KeyOnlyDictionaryGenerator *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":724
 * 
 *     def __init__(self):
 *         self.inst = shared_ptr[_KeyOnlyDictionaryGenerator](new _KeyOnlyDictionaryGenerator())             # <<<<<<<<<<<<<<
 * 
 *     def Add(self,  in_0 ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::KeyOnlyDictionaryGenerator();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryGenerator> (__pyx_t_1);

  /* "pykeyvi.pyx":723
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_KeyOnlyDictionaryGenerator](new _KeyOnlyDictionaryGenerator())
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryGenerator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":726
 *         self.inst = shared_ptr[_KeyOnlyDictionaryGenerator](new _KeyOnlyDictionaryGenerator())
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_5Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_5Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_4Add(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_4Add(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":727
 * 
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":728
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":729
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":730
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def CloseFeeding(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":726
 *         self.inst = shared_ptr[_KeyOnlyDictionaryGenerator](new _KeyOnlyDictionaryGenerator())
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryGenerator.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":732
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def CloseFeeding(self):             # <<<<<<<<<<<<<<
 *         self.inst.get().CloseFeeding()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_7CloseFeeding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_7CloseFeeding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CloseFeeding (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_6CloseFeeding(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_6CloseFeeding(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CloseFeeding", 0);

  /* "pykeyvi.pyx":733
 * 
 *     def CloseFeeding(self):
 *         self.inst.get().CloseFeeding()             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self,  in_0 ):
 */
  __pyx_v_self->inst.get()->CloseFeeding();

  /* "pykeyvi.pyx":732
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def CloseFeeding(self):             # <<<<<<<<<<<<<<
 *         self.inst.get().CloseFeeding()
 * 
 */

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

/* "pykeyvi.pyx":735
 *         self.inst.get().CloseFeeding()
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_9WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_9WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_8WriteToFile(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_26KeyOnlyDictionaryGenerator_8WriteToFile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":736
 * 
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":737
 *     def WriteToFile(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":738
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":739
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 * cdef class KeyOnlyDictionaryCompiler:
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->WriteToFile(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":735
 *         self.inst.get().CloseFeeding()
 * 
 *     def WriteToFile(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryGenerator.WriteToFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":745
 *     cdef shared_ptr[_KeyOnlyDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler___dealloc__(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":746
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":745
 *     cdef shared_ptr[_KeyOnlyDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":749
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_3_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_2_init_0(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_2_init_0(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::KeyOnlyDictionaryCompiler *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":750
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::KeyOnlyDictionaryCompiler();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryCompiler> (__pyx_t_1);

  /* "pykeyvi.pyx":749
 * 
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler())
 * 
 */

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

/* "pykeyvi.pyx":752
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_5_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_4_init_1(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_4_init_1(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::KeyOnlyDictionaryCompiler *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":753
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":755
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::KeyOnlyDictionaryCompiler(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryCompiler> (__pyx_t_5);

  /* "pykeyvi.pyx":752
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":757
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_6_init_2(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":759
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_28_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_28_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_2generator19, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_5generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_29_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_29_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_5generator20, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_5generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":757
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_6_init_2(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::KeyOnlyDictionaryCompiler *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_27__init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct_27__init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":758
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":759
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":761
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":762
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":763
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":762
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":764
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::KeyOnlyDictionaryCompiler(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryCompiler> (__pyx_t_16);

  /* "pykeyvi.pyx":765
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":757
 *         self.inst = shared_ptr[_KeyOnlyDictionaryCompiler](new _KeyOnlyDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":767
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_9__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init__(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":772
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_31_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_31_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___2generator21, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___5generator22(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_32_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_32_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___5generator22, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___5generator22(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":767
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_30___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_30___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":768
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":769
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":770
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":771
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":772
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":773
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":775
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def Add(self,  in_0 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":767
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":777
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_11Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_11Add(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_10Add(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_10Add(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":778
 * 
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":779
 *     def Add(self,  in_0 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":780
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":781
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 *         self.inst.get().Add((<libcpp_string>in_0))             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self, bytes in_0 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":777
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def Add(self,  in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":783
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_13WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_13WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), (&PyBytes_Type), 1, "in_0", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_12WriteToFile(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), ((PyObject*)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_12WriteToFile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0) {
  const char *__pyx_v_input_in_0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  const char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);

  /* "pykeyvi.pyx":784
 * 
 *     def WriteToFile(self, bytes in_0 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         cdef const_char * input_in_0 = <const_char *> in_0
 *         self.inst.get().WriteToFile(input_in_0)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_0); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":785
 *     def WriteToFile(self, bytes in_0 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_in_0); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_in_0 = ((const char *)__pyx_t_2);

  /* "pykeyvi.pyx":786
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 *         self.inst.get().WriteToFile(input_in_0)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_v_self->inst.get()->WriteToFile(__pyx_v_input_in_0);

  /* "pykeyvi.pyx":783
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 */

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

/* "pykeyvi.pyx":788
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_14__enter__(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_14__enter__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pykeyvi.pyx":789
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":788
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":792
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,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_type)) != 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("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_16__exit__(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_16__exit__(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pykeyvi.pyx":793
 * 
 *     def __exit__(self, type, value, traceback):
 *         self.Compile()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __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;

  /* "pykeyvi.pyx":792
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":796
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_19Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_19Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compile (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Compile", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_18Compile(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_18Compile(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args) {
  void *__pyx_v_callback;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("Compile", 0);

  /* "pykeyvi.pyx":797
 * 
 *     def Compile(self, *args):
 *         if not args:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 self.inst.get().Compile()
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":798
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "pykeyvi.pyx":799
 *         if not args:
 *             with nogil:
 *                 self.inst.get().Compile()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
          __pyx_v_self->inst.get()->Compile();
        }

        /* "pykeyvi.pyx":798
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pykeyvi.pyx":800
 *             with nogil:
 *                 self.inst.get().Compile()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef void* callback = <void*> args[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":802
 *             return
 * 
 *         cdef void* callback = <void*> args[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)
 */
  __pyx_v_callback = ((void *)PyTuple_GET_ITEM(__pyx_v_args, 0));

  /* "pykeyvi.pyx":803
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "pykeyvi.pyx":804
 *         cdef void* callback = <void*> args[0]
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_self->inst.get()->Compile(__pyx_f_7pykeyvi_callback_wrapper, __pyx_v_callback);
      }

      /* "pykeyvi.pyx":803
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "pykeyvi.pyx":796
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

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

/* "pykeyvi.pyx":807
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_21SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_21SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_20SetManifest(((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_25KeyOnlyDictionaryCompiler_20SetManifest(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  const char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":808
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":809
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * cdef class Match:
 */
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_m); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);

  /* "pykeyvi.pyx":807
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.KeyOnlyDictionaryCompiler.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":815
 *     cdef shared_ptr[_Match] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_5Match_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_5Match_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_5Match___dealloc__(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_5Match___dealloc__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":816
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":815
 *     cdef shared_ptr[_Match] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":819
 * 
 * 
 *     def SetEnd(self,  end ):             # <<<<<<<<<<<<<<
 *         assert isinstance(end, (int, long)), 'arg end wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_3SetEnd(PyObject *__pyx_v_self, PyObject *__pyx_v_end); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_3SetEnd(PyObject *__pyx_v_self, PyObject *__pyx_v_end) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetEnd (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_2SetEnd(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_end));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_2SetEnd(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_end) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetEnd", 0);

  /* "pykeyvi.pyx":820
 * 
 *     def SetEnd(self,  end ):
 *         assert isinstance(end, (int, long)), 'arg end wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().SetEnd((<size_t>end))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_end); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_end); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_end_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":822
 *         assert isinstance(end, (int, long)), 'arg end wrong type'
 * 
 *         self.inst.get().SetEnd((<size_t>end))             # <<<<<<<<<<<<<<
 * 
 *     def GetStart(self):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_end); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetEnd(((size_t)__pyx_t_4));

  /* "pykeyvi.pyx":819
 * 
 * 
 *     def SetEnd(self,  end ):             # <<<<<<<<<<<<<<
 *         assert isinstance(end, (int, long)), 'arg end wrong type'
 * 
 */

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

/* "pykeyvi.pyx":824
 *         self.inst.get().SetEnd((<size_t>end))
 * 
 *     def GetStart(self):             # <<<<<<<<<<<<<<
 *         cdef size_t _r = self.inst.get().GetStart()
 *         py_result = <size_t>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_5GetStart(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_5GetStart(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetStart (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_4GetStart(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_4GetStart(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  size_t __pyx_v__r;
  size_t __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetStart", 0);

  /* "pykeyvi.pyx":825
 * 
 *     def GetStart(self):
 *         cdef size_t _r = self.inst.get().GetStart()             # <<<<<<<<<<<<<<
 *         py_result = <size_t>_r
 *         return py_result
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetStart();

  /* "pykeyvi.pyx":826
 *     def GetStart(self):
 *         cdef size_t _r = self.inst.get().GetStart()
 *         py_result = <size_t>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((size_t)__pyx_v__r);

  /* "pykeyvi.pyx":827
 *         cdef size_t _r = self.inst.get().GetStart()
 *         py_result = <size_t>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def GetScore(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_py_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":824
 *         self.inst.get().SetEnd((<size_t>end))
 * 
 *     def GetStart(self):             # <<<<<<<<<<<<<<
 *         cdef size_t _r = self.inst.get().GetStart()
 *         py_result = <size_t>_r
 */

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

/* "pykeyvi.pyx":829
 *         return py_result
 * 
 *     def GetScore(self):             # <<<<<<<<<<<<<<
 *         cdef float _r = self.inst.get().GetScore()
 *         py_result = <float>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_7GetScore(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_7GetScore(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetScore (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_6GetScore(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_6GetScore(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  float __pyx_v__r;
  PyObject *__pyx_v_py_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetScore", 0);

  /* "pykeyvi.pyx":830
 * 
 *     def GetScore(self):
 *         cdef float _r = self.inst.get().GetScore()             # <<<<<<<<<<<<<<
 *         py_result = <float>_r
 *         return py_result
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetScore();

  /* "pykeyvi.pyx":831
 *     def GetScore(self):
 *         cdef float _r = self.inst.get().GetScore()
 *         py_result = <float>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(((float)__pyx_v__r)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_py_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":832
 *         cdef float _r = self.inst.get().GetScore()
 *         py_result = <float>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def SetMatchedString(self,  matched_string ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_result);
  __pyx_r = __pyx_v_py_result;
  goto __pyx_L0;

  /* "pykeyvi.pyx":829
 *         return py_result
 * 
 *     def GetScore(self):             # <<<<<<<<<<<<<<
 *         cdef float _r = self.inst.get().GetScore()
 *         py_result = <float>_r
 */

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

/* "pykeyvi.pyx":834
 *         return py_result
 * 
 *     def SetMatchedString(self,  matched_string ):             # <<<<<<<<<<<<<<
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'
 *         if isinstance(matched_string, unicode):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_9SetMatchedString(PyObject *__pyx_v_self, PyObject *__pyx_v_matched_string); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_9SetMatchedString(PyObject *__pyx_v_self, PyObject *__pyx_v_matched_string) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetMatchedString (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_8SetMatchedString(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_matched_string));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_8SetMatchedString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_matched_string) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetMatchedString", 0);
  __Pyx_INCREF(__pyx_v_matched_string);

  /* "pykeyvi.pyx":835
 * 
 *     def SetMatchedString(self,  matched_string ):
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(matched_string, unicode):
 *             matched_string = matched_string.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_matched_string); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_matched_string); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_matched_string_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":836
 *     def SetMatchedString(self,  matched_string ):
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'
 *         if isinstance(matched_string, unicode):             # <<<<<<<<<<<<<<
 *             matched_string = matched_string.encode('utf-8')
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_matched_string); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":837
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'
 *         if isinstance(matched_string, unicode):
 *             matched_string = matched_string.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_matched_string, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_matched_string, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pykeyvi.pyx":838
 *         if isinstance(matched_string, unicode):
 *             matched_string = matched_string.encode('utf-8')
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))             # <<<<<<<<<<<<<<
 * 
 *     def GetValueAsString(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_matched_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetMatchedString(((std::string)__pyx_t_6));

  /* "pykeyvi.pyx":834
 *         return py_result
 * 
 *     def SetMatchedString(self,  matched_string ):             # <<<<<<<<<<<<<<
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'
 *         if isinstance(matched_string, unicode):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.Match.SetMatchedString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matched_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":840
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))
 * 
 *     def GetValueAsString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetValueAsString()
 *         py_result = <libcpp_string>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_11GetValueAsString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_11GetValueAsString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetValueAsString (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_10GetValueAsString(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_10GetValueAsString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetValueAsString", 0);

  /* "pykeyvi.pyx":841
 * 
 *     def GetValueAsString(self):
 *         cdef libcpp_string _r = self.inst.get().GetValueAsString()             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  try {
    __pyx_t_1 = __pyx_v_self->inst.get()->GetValueAsString();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v__r = __pyx_t_1;

  /* "pykeyvi.pyx":842
 *     def GetValueAsString(self):
 *         cdef libcpp_string _r = self.inst.get().GetValueAsString()
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":843
 *         cdef libcpp_string _r = self.inst.get().GetValueAsString()
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def IsEmpty(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":840
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))
 * 
 *     def GetValueAsString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetValueAsString()
 *         py_result = <libcpp_string>_r
 */

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

/* "pykeyvi.pyx":845
 *         return py_result
 * 
 *     def IsEmpty(self):             # <<<<<<<<<<<<<<
 *         cdef bool _r = self.inst.get().IsEmpty()
 *         py_result = <bool>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_13IsEmpty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_13IsEmpty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("IsEmpty (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_12IsEmpty(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_12IsEmpty(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  bool __pyx_v__r;
  bool __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("IsEmpty", 0);

  /* "pykeyvi.pyx":846
 * 
 *     def IsEmpty(self):
 *         cdef bool _r = self.inst.get().IsEmpty()             # <<<<<<<<<<<<<<
 *         py_result = <bool>_r
 *         return py_result
 */
  __pyx_v__r = __pyx_v_self->inst.get()->IsEmpty();

  /* "pykeyvi.pyx":847
 *     def IsEmpty(self):
 *         cdef bool _r = self.inst.get().IsEmpty()
 *         py_result = <bool>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((bool)__pyx_v__r);

  /* "pykeyvi.pyx":848
 *         cdef bool _r = self.inst.get().IsEmpty()
 *         py_result = <bool>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def SetScore(self, float score ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_py_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":845
 *         return py_result
 * 
 *     def IsEmpty(self):             # <<<<<<<<<<<<<<
 *         cdef bool _r = self.inst.get().IsEmpty()
 *         py_result = <bool>_r
 */

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

/* "pykeyvi.pyx":850
 *         return py_result
 * 
 *     def SetScore(self, float score ):             # <<<<<<<<<<<<<<
 *         assert isinstance(score, float), 'arg score wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_15SetScore(PyObject *__pyx_v_self, PyObject *__pyx_arg_score); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_15SetScore(PyObject *__pyx_v_self, PyObject *__pyx_arg_score) {
  float __pyx_v_score;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetScore (wrapper)", 0);
  assert(__pyx_arg_score); {
    __pyx_v_score = __pyx_PyFloat_AsFloat(__pyx_arg_score); if (unlikely((__pyx_v_score == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Match.SetScore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_5Match_14SetScore(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((float)__pyx_v_score));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_14SetScore(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, float __pyx_v_score) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetScore", 0);

  /* "pykeyvi.pyx":851
 * 
 *     def SetScore(self, float score ):
 *         assert isinstance(score, float), 'arg score wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().SetScore((<float>score))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyFloat_Check(__pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_score_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":853
 *         assert isinstance(score, float), 'arg score wrong type'
 * 
 *         self.inst.get().SetScore((<float>score))             # <<<<<<<<<<<<<<
 * 
 *     def GetRawValueAsString(self):
 */
  __pyx_v_self->inst.get()->SetScore(((float)__pyx_v_score));

  /* "pykeyvi.pyx":850
 *         return py_result
 * 
 *     def SetScore(self, float score ):             # <<<<<<<<<<<<<<
 *         assert isinstance(score, float), 'arg score wrong type'
 * 
 */

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

/* "pykeyvi.pyx":855
 *         self.inst.get().SetScore((<float>score))
 * 
 *     def GetRawValueAsString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetRawValueAsString()
 *         py_result = <libcpp_string>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_17GetRawValueAsString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_17GetRawValueAsString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetRawValueAsString (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_16GetRawValueAsString(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_16GetRawValueAsString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetRawValueAsString", 0);

  /* "pykeyvi.pyx":856
 * 
 *     def GetRawValueAsString(self):
 *         cdef libcpp_string _r = self.inst.get().GetRawValueAsString()             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  try {
    __pyx_t_1 = __pyx_v_self->inst.get()->GetRawValueAsString();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v__r = __pyx_t_1;

  /* "pykeyvi.pyx":857
 *     def GetRawValueAsString(self):
 *         cdef libcpp_string _r = self.inst.get().GetRawValueAsString()
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":858
 *         cdef libcpp_string _r = self.inst.get().GetRawValueAsString()
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def SetStart(self,  start ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":855
 *         self.inst.get().SetScore((<float>score))
 * 
 *     def GetRawValueAsString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetRawValueAsString()
 *         py_result = <libcpp_string>_r
 */

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

/* "pykeyvi.pyx":860
 *         return py_result
 * 
 *     def SetStart(self,  start ):             # <<<<<<<<<<<<<<
 *         assert isinstance(start, (int, long)), 'arg start wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_19SetStart(PyObject *__pyx_v_self, PyObject *__pyx_v_start); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_19SetStart(PyObject *__pyx_v_self, PyObject *__pyx_v_start) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetStart (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_18SetStart(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_start));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_18SetStart(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_start) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetStart", 0);

  /* "pykeyvi.pyx":861
 * 
 *     def SetStart(self,  start ):
 *         assert isinstance(start, (int, long)), 'arg start wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().SetStart((<size_t>start))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_start); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_start); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_start_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":863
 *         assert isinstance(start, (int, long)), 'arg start wrong type'
 * 
 *         self.inst.get().SetStart((<size_t>start))             # <<<<<<<<<<<<<<
 * 
 *     def GetEnd(self):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_start); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetStart(((size_t)__pyx_t_4));

  /* "pykeyvi.pyx":860
 *         return py_result
 * 
 *     def SetStart(self,  start ):             # <<<<<<<<<<<<<<
 *         assert isinstance(start, (int, long)), 'arg start wrong type'
 * 
 */

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

/* "pykeyvi.pyx":865
 *         self.inst.get().SetStart((<size_t>start))
 * 
 *     def GetEnd(self):             # <<<<<<<<<<<<<<
 *         cdef size_t _r = self.inst.get().GetEnd()
 *         py_result = <size_t>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_21GetEnd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_21GetEnd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetEnd (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_20GetEnd(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_20GetEnd(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  size_t __pyx_v__r;
  size_t __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetEnd", 0);

  /* "pykeyvi.pyx":866
 * 
 *     def GetEnd(self):
 *         cdef size_t _r = self.inst.get().GetEnd()             # <<<<<<<<<<<<<<
 *         py_result = <size_t>_r
 *         return py_result
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetEnd();

  /* "pykeyvi.pyx":867
 *     def GetEnd(self):
 *         cdef size_t _r = self.inst.get().GetEnd()
 *         py_result = <size_t>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((size_t)__pyx_v__r);

  /* "pykeyvi.pyx":868
 *         cdef size_t _r = self.inst.get().GetEnd()
 *         py_result = <size_t>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_py_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":865
 *         self.inst.get().SetStart((<size_t>start))
 * 
 *     def GetEnd(self):             # <<<<<<<<<<<<<<
 *         cdef size_t _r = self.inst.get().GetEnd()
 *         py_result = <size_t>_r
 */

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

/* "pykeyvi.pyx":870
 *         return py_result
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_23__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_23__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_22__copy__(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_22__copy__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_rv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__copy__", 0);

  /* "pykeyvi.pyx":871
 * 
 *     def __copy__(self):
 *        cdef Match rv = Match.__new__(Match)             # <<<<<<<<<<<<<<
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 *        return rv
 */
  __pyx_t_1 = __pyx_tp_new_7pykeyvi_Match(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pykeyvi_Match)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_rv = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":872
 *     def __copy__(self):
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))             # <<<<<<<<<<<<<<
 *        return rv
 * 
 */
  __pyx_v_rv->inst = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match((*__pyx_v_self->inst.get())));

  /* "pykeyvi.pyx":873
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 *        return rv             # <<<<<<<<<<<<<<
 * 
 *     def __deepcopy__(self, memo):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rv));
  __pyx_r = ((PyObject *)__pyx_v_rv);
  goto __pyx_L0;

  /* "pykeyvi.pyx":870
 *         return py_result
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pykeyvi.Match.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":875
 *        return rv
 * 
 *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_25__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_25__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_24__deepcopy__(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_memo));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_24__deepcopy__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) {
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_rv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__deepcopy__", 0);

  /* "pykeyvi.pyx":876
 * 
 *     def __deepcopy__(self, memo):
 *        cdef Match rv = Match.__new__(Match)             # <<<<<<<<<<<<<<
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 *        return rv
 */
  __pyx_t_1 = __pyx_tp_new_7pykeyvi_Match(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pykeyvi_Match)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_rv = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":877
 *     def __deepcopy__(self, memo):
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))             # <<<<<<<<<<<<<<
 *        return rv
 * 
 */
  __pyx_v_rv->inst = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match((*__pyx_v_self->inst.get())));

  /* "pykeyvi.pyx":878
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 *        return rv             # <<<<<<<<<<<<<<
 * 
 *     def _init_0(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rv));
  __pyx_r = ((PyObject *)__pyx_v_rv);
  goto __pyx_L0;

  /* "pykeyvi.pyx":875
 *        return rv
 * 
 *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
 *        cdef Match rv = Match.__new__(Match)
 *        rv.inst = shared_ptr[_Match](new _Match(deref(self.inst.get())))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pykeyvi.Match.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":880
 *        return rv
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_Match](new _Match())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_27_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_27_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_26_init_0(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_26_init_0(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":881
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_Match](new _Match())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self, Match m ):
 */
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match());

  /* "pykeyvi.pyx":880
 *        return rv
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_Match](new _Match())
 * 
 */

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

/* "pykeyvi.pyx":883
 *         self.inst = shared_ptr[_Match](new _Match())
 * 
 *     def _init_1(self, Match m ):             # <<<<<<<<<<<<<<
 *         assert isinstance(m, Match), 'arg m wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_29_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_m); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_29_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_m) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_7pykeyvi_Match, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_5Match_28_init_1(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_m));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_28_init_1(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, struct __pyx_obj_7pykeyvi_Match *__pyx_v_m) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":884
 * 
 *     def _init_1(self, Match m ):
 *         assert isinstance(m, Match), 'arg m wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_Match](new _Match((deref(m.inst.get()))))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_m), ((PyObject*)__pyx_ptype_7pykeyvi_Match)); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_m_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":886
 *         assert isinstance(m, Match), 'arg m wrong type'
 * 
 *         self.inst = shared_ptr[_Match](new _Match((deref(m.inst.get()))))             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::Match> (new keyvi::dictionary::Match((*__pyx_v_m->inst.get())));

  /* "pykeyvi.pyx":883
 *         self.inst = shared_ptr[_Match](new _Match())
 * 
 *     def _init_1(self, Match m ):             # <<<<<<<<<<<<<<
 *         assert isinstance(m, Match), 'arg m wrong type'
 * 
 */

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

/* "pykeyvi.pyx":888
 *         self.inst = shared_ptr[_Match](new _Match((deref(m.inst.get()))))
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_5Match_31__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_5Match_31__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_5Match_30__init__(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static int __pyx_pf_7pykeyvi_5Match_30__init__(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pykeyvi.pyx":889
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], Match)):
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":890
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], Match)):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":891
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], Match)):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         else:
 */
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_5, ((PyObject*)__pyx_ptype_7pykeyvi_Match)); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":892
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], Match)):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":894
 *              self._init_1(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def GetMatchedString(self):
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":888
 *         self.inst = shared_ptr[_Match](new _Match((deref(m.inst.get()))))
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

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

/* "pykeyvi.pyx":896
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def GetMatchedString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetMatchedString()
 *         py_result = <libcpp_string>_r
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_33GetMatchedString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_33GetMatchedString(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetMatchedString (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_32GetMatchedString(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_32GetMatchedString(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  std::string __pyx_v__r;
  std::string __pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetMatchedString", 0);

  /* "pykeyvi.pyx":897
 * 
 *     def GetMatchedString(self):
 *         cdef libcpp_string _r = self.inst.get().GetMatchedString()             # <<<<<<<<<<<<<<
 *         py_result = <libcpp_string>_r
 *         return py_result
 */
  __pyx_v__r = __pyx_v_self->inst.get()->GetMatchedString();

  /* "pykeyvi.pyx":898
 *     def GetMatchedString(self):
 *         cdef libcpp_string _r = self.inst.get().GetMatchedString()
 *         py_result = <libcpp_string>_r             # <<<<<<<<<<<<<<
 *         return py_result
 * 
 */
  __pyx_v_py_result = ((std::string)__pyx_v__r);

  /* "pykeyvi.pyx":899
 *         cdef libcpp_string _r = self.inst.get().GetMatchedString()
 *         py_result = <libcpp_string>_r
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 *     def GetAttribute(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_py_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":896
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def GetMatchedString(self):             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().GetMatchedString()
 *         py_result = <libcpp_string>_r
 */

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

/* "pykeyvi.pyx":901
 *         return py_result
 * 
 *     def GetAttribute(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_35GetAttribute(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_35GetAttribute(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetAttribute (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_34GetAttribute(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_34GetAttribute(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_py_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  PyObject *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetAttribute", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "pykeyvi.pyx":902
 * 
 *     def GetAttribute(self, key):
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode("utf-8")
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":903
 *     def GetAttribute(self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")             # <<<<<<<<<<<<<<
 * 
 *         py_result = self.inst.get().GetAttributePy(<libcpp_string> key)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":905
 *             key = key.encode("utf-8")
 * 
 *         py_result = self.inst.get().GetAttributePy(<libcpp_string> key)             # <<<<<<<<<<<<<<
 *         return <object>py_result
 * 
 */
  __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_6 = __pyx_v_self->inst.get()->GetAttributePy(((std::string)__pyx_t_5));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_py_result = __pyx_t_6;

  /* "pykeyvi.pyx":906
 * 
 *         py_result = self.inst.get().GetAttributePy(<libcpp_string> key)
 *         return <object>py_result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":901
 *         return py_result
 * 
 *     def GetAttribute(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")
 */

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

/* "pykeyvi.pyx":909
 * 
 * 
 *     def SetAttribute(self, key, value):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_37SetAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_37SetAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetAttribute (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("SetAttribute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SetAttribute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("SetAttribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Match.SetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_5Match_36SetAttribute(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_7pykeyvi_5Match_36SetAttribute(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_value_utf8 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  float __pyx_t_7;
  int __pyx_t_8;
  bool __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetAttribute", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "pykeyvi.pyx":910
 * 
 *     def SetAttribute(self, key, value):
 *         if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *             key = key.encode("utf-8")
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":911
 *     def SetAttribute(self, key, value):
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")             # <<<<<<<<<<<<<<
 * 
 *         t = type(value)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":913
 *             key = key.encode("utf-8")
 * 
 *         t = type(value)             # <<<<<<<<<<<<<<
 *         if t == str:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
  __pyx_v_t = ((PyObject*)((PyObject *)Py_TYPE(__pyx_v_value)));

  /* "pykeyvi.pyx":914
 * 
 *         t = type(value)
 *         if t == str:             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)
 *         elif t == unicode:
 */
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)((PyObject*)(&PyString_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":915
 *         t = type(value)
 *         if t == str:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)             # <<<<<<<<<<<<<<
 *         elif t == unicode:
 *             value_utf8 = value.encode("utf-8")
 */
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {
      __pyx_v_self->inst.get()->SetAttribute(((std::string)__pyx_t_5), ((std::string)__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L4;
  }

  /* "pykeyvi.pyx":916
 *         if t == str:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)
 *         elif t == unicode:             # <<<<<<<<<<<<<<
 *             value_utf8 = value.encode("utf-8")
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)
 */
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)((PyObject*)(&PyUnicode_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":917
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)
 *         elif t == unicode:
 *             value_utf8 = value.encode("utf-8")             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)
 *         elif t == float:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_value_utf8 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pykeyvi.pyx":918
 *         elif t == unicode:
 *             value_utf8 = value.encode("utf-8")
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)             # <<<<<<<<<<<<<<
 *         elif t == float:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <float> value)
 */
    __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_value_utf8); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {
      __pyx_v_self->inst.get()->SetAttribute(((std::string)__pyx_t_6), ((std::string)__pyx_t_5));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L4;
  }

  /* "pykeyvi.pyx":919
 *             value_utf8 = value.encode("utf-8")
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)
 *         elif t == float:             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <float> value)
 *         elif t == int:
 */
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":920
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)
 *         elif t == float:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <float> value)             # <<<<<<<<<<<<<<
 *         elif t == int:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <int> value)
 */
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {
      __pyx_v_self->inst.get()->SetAttribute(((std::string)__pyx_t_5), ((float)__pyx_t_7));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L4;
  }

  /* "pykeyvi.pyx":921
 *         elif t == float:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <float> value)
 *         elif t == int:             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <int> value)
 *         # special trick as t == bool does not work due to name collision between cython and C
 */
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":922
 *             self.inst.get().SetAttribute(<libcpp_string> key, <float> value)
 *         elif t == int:
 *             self.inst.get().SetAttribute(<libcpp_string> key, <int> value)             # <<<<<<<<<<<<<<
 *         # special trick as t == bool does not work due to name collision between cython and C
 *         elif isinstance(value, (int)):
 */
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {
      __pyx_v_self->inst.get()->SetAttribute(((std::string)__pyx_t_5), ((int)__pyx_t_8));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L4;
  }

  /* "pykeyvi.pyx":924
 *             self.inst.get().SetAttribute(<libcpp_string> key, <int> value)
 *         # special trick as t == bool does not work due to name collision between cython and C
 *         elif isinstance(value, (int)):             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <bool> value)
 *         else:
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":925
 *         # special trick as t == bool does not work due to name collision between cython and C
 *         elif isinstance(value, (int)):
 *             self.inst.get().SetAttribute(<libcpp_string> key, <bool> value)             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception("Unsupported Value Type")
 */
    __pyx_t_5 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_9 == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    try {
      __pyx_v_self->inst.get()->SetAttribute(((std::string)__pyx_t_5), ((bool)__pyx_t_9));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pykeyvi.pyx":927
 *             self.inst.get().SetAttribute(<libcpp_string> key, <bool> value)
 *         else:
 *             raise Exception("Unsupported Value Type")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pykeyvi.pyx":909
 * 
 * 
 *     def SetAttribute(self, key, value):             # <<<<<<<<<<<<<<
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.Match.SetAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_value_utf8);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":930
 * 
 * 
 *     def GetValue(self):             # <<<<<<<<<<<<<<
 *         """Decodes a keyvi value and returns it."""
 *         cdef libcpp_string packed_value = self.inst.get().GetMsgPackedValueAsString()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_39GetValue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pykeyvi_5Match_38GetValue[] = "Decodes a keyvi value and returns it.";
static PyObject *__pyx_pw_7pykeyvi_5Match_39GetValue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetValue (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_38GetValue(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_38GetValue(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  std::string __pyx_v_packed_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetValue", 0);

  /* "pykeyvi.pyx":932
 *     def GetValue(self):
 *         """Decodes a keyvi value and returns it."""
 *         cdef libcpp_string packed_value = self.inst.get().GetMsgPackedValueAsString()             # <<<<<<<<<<<<<<
 *         if packed_value.empty():
 *             return None
 */
  try {
    __pyx_t_1 = __pyx_v_self->inst.get()->GetMsgPackedValueAsString();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_packed_value = __pyx_t_1;

  /* "pykeyvi.pyx":933
 *         """Decodes a keyvi value and returns it."""
 *         cdef libcpp_string packed_value = self.inst.get().GetMsgPackedValueAsString()
 *         if packed_value.empty():             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_2 = (__pyx_v_packed_value.empty() != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":934
 *         cdef libcpp_string packed_value = self.inst.get().GetMsgPackedValueAsString()
 *         if packed_value.empty():
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         return msgpack.loads(packed_value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":936
 *             return None
 * 
 *         return msgpack.loads(packed_value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_msgpack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __pyx_convert_string_to_py_(__pyx_v_packed_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":930
 * 
 * 
 *     def GetValue(self):             # <<<<<<<<<<<<<<
 *         """Decodes a keyvi value and returns it."""
 *         cdef libcpp_string packed_value = self.inst.get().GetMsgPackedValueAsString()
 */

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

/* "pykeyvi.pyx":939
 * 
 * 
 *     def dumps(self):             # <<<<<<<<<<<<<<
 *         m=[]
 *         do_pack_rest = False
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_41dumps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_41dumps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dumps (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_40dumps(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_40dumps(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self) {
  PyObject *__pyx_v_m = NULL;
  int __pyx_v_do_pack_rest;
  PyObject *__pyx_v_score = NULL;
  size_t __pyx_v_end;
  size_t __pyx_v_start;
  std::string __pyx_v_matchedstring;
  std::string __pyx_v_rawvalue;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  std::string __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dumps", 0);

  /* "pykeyvi.pyx":940
 * 
 *     def dumps(self):
 *         m=[]             # <<<<<<<<<<<<<<
 *         do_pack_rest = False
 *         score = self.inst.get().GetScore()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_m = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":941
 *     def dumps(self):
 *         m=[]
 *         do_pack_rest = False             # <<<<<<<<<<<<<<
 *         score = self.inst.get().GetScore()
 *         if score != 0:
 */
  __pyx_v_do_pack_rest = 0;

  /* "pykeyvi.pyx":942
 *         m=[]
 *         do_pack_rest = False
 *         score = self.inst.get().GetScore()             # <<<<<<<<<<<<<<
 *         if score != 0:
 *             m.append(score)
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->inst.get()->GetScore()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_score = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":943
 *         do_pack_rest = False
 *         score = self.inst.get().GetScore()
 *         if score != 0:             # <<<<<<<<<<<<<<
 *             m.append(score)
 *             do_pack_rest = True
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_score, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":944
 *         score = self.inst.get().GetScore()
 *         if score != 0:
 *             m.append(score)             # <<<<<<<<<<<<<<
 *             do_pack_rest = True
 *         end = self.inst.get().GetEnd()
 */
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_m, __pyx_v_score); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pykeyvi.pyx":945
 *         if score != 0:
 *             m.append(score)
 *             do_pack_rest = True             # <<<<<<<<<<<<<<
 *         end = self.inst.get().GetEnd()
 *         if end != 0 or do_pack_rest:
 */
    __pyx_v_do_pack_rest = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":946
 *             m.append(score)
 *             do_pack_rest = True
 *         end = self.inst.get().GetEnd()             # <<<<<<<<<<<<<<
 *         if end != 0 or do_pack_rest:
 *             m.append(end)
 */
  __pyx_v_end = __pyx_v_self->inst.get()->GetEnd();

  /* "pykeyvi.pyx":947
 *             do_pack_rest = True
 *         end = self.inst.get().GetEnd()
 *         if end != 0 or do_pack_rest:             # <<<<<<<<<<<<<<
 *             m.append(end)
 *             do_pack_rest = True
 */
  __pyx_t_4 = ((__pyx_v_end != 0) != 0);
  if (!__pyx_t_4) {
    goto __pyx_L6_next_or;
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L6_next_or:;
  __pyx_t_4 = (__pyx_v_do_pack_rest != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":948
 *         end = self.inst.get().GetEnd()
 *         if end != 0 or do_pack_rest:
 *             m.append(end)             # <<<<<<<<<<<<<<
 *             do_pack_rest = True
 *         start = self.inst.get().GetStart()
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_m, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pykeyvi.pyx":949
 *         if end != 0 or do_pack_rest:
 *             m.append(end)
 *             do_pack_rest = True             # <<<<<<<<<<<<<<
 *         start = self.inst.get().GetStart()
 *         if start != 0 or do_pack_rest:
 */
    __pyx_v_do_pack_rest = 1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pykeyvi.pyx":950
 *             m.append(end)
 *             do_pack_rest = True
 *         start = self.inst.get().GetStart()             # <<<<<<<<<<<<<<
 *         if start != 0 or do_pack_rest:
 *             m.append(start)
 */
  __pyx_v_start = __pyx_v_self->inst.get()->GetStart();

  /* "pykeyvi.pyx":951
 *             do_pack_rest = True
 *         start = self.inst.get().GetStart()
 *         if start != 0 or do_pack_rest:             # <<<<<<<<<<<<<<
 *             m.append(start)
 *             do_pack_rest = True
 */
  __pyx_t_4 = ((__pyx_v_start != 0) != 0);
  if (!__pyx_t_4) {
    goto __pyx_L9_next_or;
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_or:;
  __pyx_t_4 = (__pyx_v_do_pack_rest != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":952
 *         start = self.inst.get().GetStart()
 *         if start != 0 or do_pack_rest:
 *             m.append(start)             # <<<<<<<<<<<<<<
 *             do_pack_rest = True
 *         matchedstring = self.inst.get().GetMatchedString()
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_m, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pykeyvi.pyx":953
 *         if start != 0 or do_pack_rest:
 *             m.append(start)
 *             do_pack_rest = True             # <<<<<<<<<<<<<<
 *         matchedstring = self.inst.get().GetMatchedString()
 *         if len(matchedstring) != 0 or do_pack_rest:
 */
    __pyx_v_do_pack_rest = 1;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":954
 *             m.append(start)
 *             do_pack_rest = True
 *         matchedstring = self.inst.get().GetMatchedString()             # <<<<<<<<<<<<<<
 *         if len(matchedstring) != 0 or do_pack_rest:
 *             m.append(matchedstring)
 */
  __pyx_v_matchedstring = __pyx_v_self->inst.get()->GetMatchedString();

  /* "pykeyvi.pyx":955
 *             do_pack_rest = True
 *         matchedstring = self.inst.get().GetMatchedString()
 *         if len(matchedstring) != 0 or do_pack_rest:             # <<<<<<<<<<<<<<
 *             m.append(matchedstring)
 *             do_pack_rest = True
 */
  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_matchedstring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((__pyx_t_5 != 0) != 0);
  if (!__pyx_t_4) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_4 = (__pyx_v_do_pack_rest != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":956
 *         matchedstring = self.inst.get().GetMatchedString()
 *         if len(matchedstring) != 0 or do_pack_rest:
 *             m.append(matchedstring)             # <<<<<<<<<<<<<<
 *             do_pack_rest = True
 *         rawvalue = self.inst.get().GetRawValueAsString()
 */
    __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_matchedstring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_m, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pykeyvi.pyx":957
 *         if len(matchedstring) != 0 or do_pack_rest:
 *             m.append(matchedstring)
 *             do_pack_rest = True             # <<<<<<<<<<<<<<
 *         rawvalue = self.inst.get().GetRawValueAsString()
 *         if len(rawvalue) != 0 or do_pack_rest:
 */
    __pyx_v_do_pack_rest = 1;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pykeyvi.pyx":958
 *             m.append(matchedstring)
 *             do_pack_rest = True
 *         rawvalue = self.inst.get().GetRawValueAsString()             # <<<<<<<<<<<<<<
 *         if len(rawvalue) != 0 or do_pack_rest:
 *             m.append(rawvalue)
 */
  try {
    __pyx_t_6 = __pyx_v_self->inst.get()->GetRawValueAsString();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_rawvalue = __pyx_t_6;

  /* "pykeyvi.pyx":959
 *             do_pack_rest = True
 *         rawvalue = self.inst.get().GetRawValueAsString()
 *         if len(rawvalue) != 0 or do_pack_rest:             # <<<<<<<<<<<<<<
 *             m.append(rawvalue)
 *         m.reverse()
 */
  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_rawvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((__pyx_t_5 != 0) != 0);
  if (!__pyx_t_4) {
    goto __pyx_L15_next_or;
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_L15_next_or:;
  __pyx_t_4 = (__pyx_v_do_pack_rest != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":960
 *         rawvalue = self.inst.get().GetRawValueAsString()
 *         if len(rawvalue) != 0 or do_pack_rest:
 *             m.append(rawvalue)             # <<<<<<<<<<<<<<
 *         m.reverse()
 *         return msgpack.dumps(m)
 */
    __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_rawvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_m, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pykeyvi.pyx":961
 *         if len(rawvalue) != 0 or do_pack_rest:
 *             m.append(rawvalue)
 *         m.reverse()             # <<<<<<<<<<<<<<
 *         return msgpack.dumps(m)
 * 
 */
  __pyx_t_3 = PyList_Reverse(__pyx_v_m); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pykeyvi.pyx":962
 *             m.append(rawvalue)
 *         m.reverse()
 *         return msgpack.dumps(m)             # <<<<<<<<<<<<<<
 * 
 *     def __SetRawValue(self, str):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_msgpack); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dumps); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_m);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_m);
    __Pyx_GIVEREF(__pyx_v_m);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pykeyvi.pyx":939
 * 
 * 
 *     def dumps(self):             # <<<<<<<<<<<<<<
 *         m=[]
 *         do_pack_rest = False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pykeyvi.Match.dumps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_score);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":964
 *         return msgpack.dumps(m)
 * 
 *     def __SetRawValue(self, str):             # <<<<<<<<<<<<<<
 *          self.inst.get().SetRawValue(<libcpp_string> str)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_43__SetRawValue(PyObject *__pyx_v_self, PyObject *__pyx_v_str); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_5Match_43__SetRawValue(PyObject *__pyx_v_self, PyObject *__pyx_v_str) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__SetRawValue (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_5Match_42__SetRawValue(((struct __pyx_obj_7pykeyvi_Match *)__pyx_v_self), ((PyObject *)__pyx_v_str));

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

static PyObject *__pyx_pf_7pykeyvi_5Match_42__SetRawValue(struct __pyx_obj_7pykeyvi_Match *__pyx_v_self, PyObject *__pyx_v_str) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__SetRawValue", 0);

  /* "pykeyvi.pyx":965
 * 
 *     def __SetRawValue(self, str):
 *          self.inst.get().SetRawValue(<libcpp_string> str)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = __pyx_convert_string_from_py_(__pyx_v_str); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->SetRawValue(((std::string)__pyx_t_1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":964
 *         return msgpack.dumps(m)
 * 
 *     def __SetRawValue(self, str):             # <<<<<<<<<<<<<<
 *          self.inst.get().SetRawValue(<libcpp_string> str)
 * 
 */

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

/* "pykeyvi.pyx":968
 * 
 *     @staticmethod
 *     def loads(serialized_match):             # <<<<<<<<<<<<<<
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_5Match_45loads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pykeyvi_5Match_45loads = {"loads", (PyCFunction)__pyx_pw_7pykeyvi_5Match_45loads, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pykeyvi_5Match_45loads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_serialized_match = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("loads (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_serialized_match,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_serialized_match)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "loads") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_serialized_match = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("loads", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.Match.loads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_5Match_44loads(__pyx_v_serialized_match);

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

static PyObject *__pyx_pf_7pykeyvi_5Match_44loads(PyObject *__pyx_v_serialized_match) {
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_m = NULL;
  PyObject *__pyx_v_unserialized = NULL;
  Py_ssize_t __pyx_v_number_of_fields;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("loads", 0);

  /* "pykeyvi.pyx":969
 *     @staticmethod
 *     def loads(serialized_match):
 *         m=Match()             # <<<<<<<<<<<<<<
 *         unserialized = msgpack.loads(serialized_match)
 *         number_of_fields = len(unserialized)
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_m = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":970
 *     def loads(serialized_match):
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)             # <<<<<<<<<<<<<<
 *         number_of_fields = len(unserialized)
 *         if number_of_fields > 0:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_msgpack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_serialized_match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_serialized_match);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_serialized_match);
    __Pyx_GIVEREF(__pyx_v_serialized_match);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unserialized = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":971
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 *         number_of_fields = len(unserialized)             # <<<<<<<<<<<<<<
 *         if number_of_fields > 0:
 *             m.__SetRawValue(unserialized[0])
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_unserialized); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_number_of_fields = __pyx_t_5;

  /* "pykeyvi.pyx":972
 *         unserialized = msgpack.loads(serialized_match)
 *         number_of_fields = len(unserialized)
 *         if number_of_fields > 0:             # <<<<<<<<<<<<<<
 *             m.__SetRawValue(unserialized[0])
 *             if number_of_fields > 1:
 */
  __pyx_t_6 = ((__pyx_v_number_of_fields > 0) != 0);
  if (__pyx_t_6) {

    /* "pykeyvi.pyx":973
 *         number_of_fields = len(unserialized)
 *         if number_of_fields > 0:
 *             m.__SetRawValue(unserialized[0])             # <<<<<<<<<<<<<<
 *             if number_of_fields > 1:
 *                 m.SetMatchedString(unserialized[1])
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_SetRawValue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_unserialized, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pykeyvi.pyx":974
 *         if number_of_fields > 0:
 *             m.__SetRawValue(unserialized[0])
 *             if number_of_fields > 1:             # <<<<<<<<<<<<<<
 *                 m.SetMatchedString(unserialized[1])
 *                 if number_of_fields > 2:
 */
    __pyx_t_6 = ((__pyx_v_number_of_fields > 1) != 0);
    if (__pyx_t_6) {

      /* "pykeyvi.pyx":975
 *             m.__SetRawValue(unserialized[0])
 *             if number_of_fields > 1:
 *                 m.SetMatchedString(unserialized[1])             # <<<<<<<<<<<<<<
 *                 if number_of_fields > 2:
 *                     m.SetStart(unserialized[2])
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_SetMatchedString); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_unserialized, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pykeyvi.pyx":976
 *             if number_of_fields > 1:
 *                 m.SetMatchedString(unserialized[1])
 *                 if number_of_fields > 2:             # <<<<<<<<<<<<<<
 *                     m.SetStart(unserialized[2])
 *                     if number_of_fields > 3:
 */
      __pyx_t_6 = ((__pyx_v_number_of_fields > 2) != 0);
      if (__pyx_t_6) {

        /* "pykeyvi.pyx":977
 *                 m.SetMatchedString(unserialized[1])
 *                 if number_of_fields > 2:
 *                     m.SetStart(unserialized[2])             # <<<<<<<<<<<<<<
 *                     if number_of_fields > 3:
 *                          m.SetEnd(unserialized[3])
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_SetStart); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_unserialized, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pykeyvi.pyx":978
 *                 if number_of_fields > 2:
 *                     m.SetStart(unserialized[2])
 *                     if number_of_fields > 3:             # <<<<<<<<<<<<<<
 *                          m.SetEnd(unserialized[3])
 *                          if number_of_fields > 4:
 */
        __pyx_t_6 = ((__pyx_v_number_of_fields > 3) != 0);
        if (__pyx_t_6) {

          /* "pykeyvi.pyx":979
 *                     m.SetStart(unserialized[2])
 *                     if number_of_fields > 3:
 *                          m.SetEnd(unserialized[3])             # <<<<<<<<<<<<<<
 *                          if number_of_fields > 4:
 *                              m.SetScore(unserialized[4])
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_SetEnd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_unserialized, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (!__pyx_t_2) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else {
            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
            PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pykeyvi.pyx":980
 *                     if number_of_fields > 3:
 *                          m.SetEnd(unserialized[3])
 *                          if number_of_fields > 4:             # <<<<<<<<<<<<<<
 *                              m.SetScore(unserialized[4])
 * 
 */
          __pyx_t_6 = ((__pyx_v_number_of_fields > 4) != 0);
          if (__pyx_t_6) {

            /* "pykeyvi.pyx":981
 *                          m.SetEnd(unserialized[3])
 *                          if number_of_fields > 4:
 *                              m.SetScore(unserialized[4])             # <<<<<<<<<<<<<<
 * 
 *         return m
 */
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_SetScore); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_unserialized, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_4 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (!__pyx_t_4) {
              __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_1);
            } else {
              __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
              PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L7;
          }
          __pyx_L7:;
          goto __pyx_L6;
        }
        __pyx_L6:;
        goto __pyx_L5;
      }
      __pyx_L5:;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":983
 *                              m.SetScore(unserialized[4])
 * 
 *         return m             # <<<<<<<<<<<<<<
 * 
 * cdef class CompletionDictionaryCompiler:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_m));
  __pyx_r = ((PyObject *)__pyx_v_m);
  goto __pyx_L0;

  /* "pykeyvi.pyx":968
 * 
 *     @staticmethod
 *     def loads(serialized_match):             # <<<<<<<<<<<<<<
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 */

  /* function 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_AddTraceback("pykeyvi.Match.loads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_unserialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":989
 *     cdef shared_ptr[_CompletionDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler___dealloc__(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self));

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

static void __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler___dealloc__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pykeyvi.pyx":990
 * 
 *     def __dealloc__(self):
 *          self.inst.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->inst.reset();

  /* "pykeyvi.pyx":989
 *     cdef shared_ptr[_CompletionDictionaryCompiler] inst
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *          self.inst.reset()
 * 
 */

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

/* "pykeyvi.pyx":993
 * 
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1); /*proto*/
static int __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_2__setitem__(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_in_0), ((PyObject *)__pyx_v_in_1));

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

static int __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_2__setitem__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":994
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":995
 *     def __setitem__(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":996
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":997
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<int>in_1))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":999
 *             in_0 = in_0.encode('utf-8')
 * 
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<int>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def Add(self,  in_0 ,  in_1 ):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_in_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->__setitem__(((std::string)__pyx_t_6), ((int)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":993
 * 
 * 
 *     def __setitem__(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1001
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<int>in_1))
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_5Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_5Add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_0 = 0;
  PyObject *__pyx_v_in_1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_0,&__pyx_n_s_in_1,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_in_0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_in_0 = values[0];
    __pyx_v_in_1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_4Add(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), __pyx_v_in_0, __pyx_v_in_1);

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_4Add(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0, PyObject *__pyx_v_in_1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Add", 0);
  __Pyx_INCREF(__pyx_v_in_0);

  /* "pykeyvi.pyx":1002
 * 
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyBytes_Check(__pyx_v_in_0); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyUnicode_Check(__pyx_v_in_0); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1003
 *     def Add(self,  in_0 ,  in_1 ):
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'             # <<<<<<<<<<<<<<
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_in_1); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L6_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_in_1); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_1_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1004
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):             # <<<<<<<<<<<<<<
 *             in_0 = in_0.encode('utf-8')
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_in_0); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":1005
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().Add((<libcpp_string>in_0), (<int>in_1))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_0, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_in_0, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pykeyvi.pyx":1007
 *             in_0 = in_0.encode('utf-8')
 * 
 *         self.inst.get().Add((<libcpp_string>in_0), (<int>in_1))             # <<<<<<<<<<<<<<
 * 
 *     def _init_0(self):
 */
  __pyx_t_6 = __pyx_convert_string_from_py_(__pyx_v_in_0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_in_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_v_self->inst.get()->Add(((std::string)__pyx_t_6), ((int)__pyx_t_7));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":1001
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<int>in_1))
 * 
 *     def Add(self,  in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.Add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1009
 *         self.inst.get().Add((<libcpp_string>in_0), (<int>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_7_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_7_init_0(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_0 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_6_init_0(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_6_init_0(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  keyvi::dictionary::CompletionDictionaryCompiler *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_0", 0);

  /* "pykeyvi.pyx":1010
 * 
 *     def _init_0(self):
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler())             # <<<<<<<<<<<<<<
 * 
 *     def _init_1(self,  memory_limit ):
 */
  try {
    __pyx_t_1 = new keyvi::dictionary::CompletionDictionaryCompiler();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::CompletionDictionaryCompiler> (__pyx_t_1);

  /* "pykeyvi.pyx":1009
 *         self.inst.get().Add((<libcpp_string>in_0), (<int>in_1))
 * 
 *     def _init_0(self):             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler())
 * 
 */

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

/* "pykeyvi.pyx":1012
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_9_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_9_init_1(PyObject *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_1 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8_init_1(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_memory_limit));

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8_init_1(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  keyvi::dictionary::CompletionDictionaryCompiler *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_1", 0);

  /* "pykeyvi.pyx":1013
 * 
 *     def _init_1(self,  memory_limit ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1015
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))             # <<<<<<<<<<<<<<
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 */
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_5 = new keyvi::dictionary::CompletionDictionaryCompiler(((size_t)__pyx_t_4));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::CompletionDictionaryCompiler> (__pyx_t_5);

  /* "pykeyvi.pyx":1012
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler())
 * 
 *     def _init_1(self,  memory_limit ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 * 
 */

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

/* "pykeyvi.pyx":1017
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_11_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_11_init_2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_limit = 0;
  PyObject *__pyx_v_value_store_params = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_limit,&__pyx_n_s_value_store_params,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_memory_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_store_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_memory_limit = values[0];
    __pyx_v_value_store_params = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_store_params), (&PyDict_Type), 1, "value_store_params", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_10_init_2(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), __pyx_v_memory_limit, __pyx_v_value_store_params);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_2generator23(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":1019
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_34_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_34_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_2generator23, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_2generator23(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_5generator24(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_35_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_35_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_5generator24, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init_2_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_5generator24(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params)) { __Pyx_RaiseClosureNameError("value_store_params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":1017
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_10_init_2(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_memory_limit, PyObject *__pyx_v_value_store_params) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *__pyx_cur_scope;
  std::map<std::string,std::string>  *__pyx_v_v1;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::map<std::string,std::string>  *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  std::string __pyx_t_13;
  std::string __pyx_t_14;
  size_t __pyx_t_15;
  keyvi::dictionary::CompletionDictionaryCompiler *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_2", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_33__init_2(__pyx_ptype_7pykeyvi___pyx_scope_struct_33__init_2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_value_store_params = __pyx_v_value_store_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_store_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_store_params);

  /* "pykeyvi.pyx":1018
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'             # <<<<<<<<<<<<<<
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyInt_Check(__pyx_v_memory_limit); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
      goto __pyx_L4_next_or;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_L4_next_or:;
    __pyx_t_3 = PyLong_Check(__pyx_v_memory_limit); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_memory_limit_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1019
 *     def _init_2(self,  memory_limit , dict value_store_params ):
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'             # <<<<<<<<<<<<<<
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_value_store_params;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyDict_Check(__pyx_t_4); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
      goto __pyx_L6_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      goto __pyx_L7_next_and;
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L7_next_and:;
    __pyx_t_4 = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_7_init_2_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_value_store_params_wrong_typ);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1021
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()             # <<<<<<<<<<<<<<
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 */
  try {
    __pyx_t_6 = new std::map<std::string,std::string> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_v1 = __pyx_t_6;

  /* "pykeyvi.pyx":1022
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_value_store_params == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_value_store_params); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "pykeyvi.pyx":1023
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1
 */
    __pyx_t_13 = __pyx_convert_string_from_py_(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __pyx_convert_string_from_py_(__pyx_v_key); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((*__pyx_v_v1)[((std::string)__pyx_t_14)]) = ((std::string)__pyx_t_13);

    /* "pykeyvi.pyx":1022
 * 
 *         cdef libcpp_map[libcpp_string, libcpp_string] * v1 = new libcpp_map[libcpp_string, libcpp_string]()
 *         for key, value in value_store_params.items():             # <<<<<<<<<<<<<<
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pykeyvi.pyx":1024
 *         for key, value in value_store_params.items():
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit), deref(v1)))             # <<<<<<<<<<<<<<
 *         del v1
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_memory_limit); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  try {
    __pyx_t_16 = new keyvi::dictionary::CompletionDictionaryCompiler(((size_t)__pyx_t_15), (*__pyx_v_v1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_self->inst = boost::shared_ptr<keyvi::dictionary::CompletionDictionaryCompiler> (__pyx_t_16);

  /* "pykeyvi.pyx":1025
 *            deref(v1)[ <libcpp_string> key ] = <libcpp_string> value
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit), deref(v1)))
 *         del v1             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args , **kwargs):
 */
  delete __pyx_v_v1;

  /* "pykeyvi.pyx":1017
 *         self.inst = shared_ptr[_CompletionDictionaryCompiler](new _CompletionDictionaryCompiler((<size_t>memory_limit)))
 * 
 *     def _init_2(self,  memory_limit , dict value_store_params ):             # <<<<<<<<<<<<<<
 *         assert isinstance(memory_limit, (int, long)), 'arg memory_limit wrong type'
 *         assert isinstance(value_store_params, dict) and all(isinstance(k, bytes) for k in value_store_params.keys()) and all(isinstance(v, bytes) for v in value_store_params.values()), 'arg value_store_params wrong type'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler._init_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1027
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

/* Python wrapper */
static int __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_13__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_13__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_12__init__(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___2generator25(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pykeyvi.pyx":1032
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_37_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_37_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___2generator25, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___2generator25(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_k); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___5generator26(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_38_genexpr(__pyx_ptype_7pykeyvi___pyx_scope_struct_38_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___5generator26, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7pykeyvi_28CompletionDictionaryCompiler_8__init___5generator26(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args, 1), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #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_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_6 = PyBytes_Check(__pyx_cur_scope->__pyx_v_v); 
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pykeyvi.pyx":1027
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

static int __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_12__init__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *__pyx_cur_scope;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)__pyx_tp_new_7pykeyvi___pyx_scope_struct_36___init__(__pyx_ptype_7pykeyvi___pyx_scope_struct_36___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);

  /* "pykeyvi.pyx":1028
 * 
 *     def __init__(self, *args , **kwargs):
 *         if not args:             # <<<<<<<<<<<<<<
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":1029
 *     def __init__(self, *args , **kwargs):
 *         if not args:
 *              self._init_0(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":1030
 *         if not args:
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):             # <<<<<<<<<<<<<<
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_1) {
    goto __pyx_L5_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = PyInt_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L7_next_or;
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_L7_next_or:;
  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = PyLong_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":1031
 *              self._init_0(*args)
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)             # <<<<<<<<<<<<<<
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pykeyvi.pyx":1032
 *         elif (len(args)==1) and (isinstance(args[0], (int, long))):
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):             # <<<<<<<<<<<<<<
 *              self._init_2(*args)
 *         else:
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_7) {
    goto __pyx_L9_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (!__pyx_t_8) {
    goto __pyx_L12_next_or;
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_L12_next_or:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_7 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {
    goto __pyx_L10_next_and;
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L10_next_and:;
  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_args, 1);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyDict_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
    goto __pyx_L13_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L13_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    goto __pyx_L14_next_and;
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L14_next_and:;
  __pyx_t_3 = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_8__init___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_all, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":1033
 *              self._init_1(*args)
 *         elif (len(args)==2) and (isinstance(args[0], (int, long))) and (isinstance(args[1], dict) and all(isinstance(k, bytes) for k in args[1].keys()) and all(isinstance(v, bytes) for v in args[1].values())):
 *              self._init_2(*args)             # <<<<<<<<<<<<<<
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pykeyvi.pyx":1035
 *              self._init_2(*args)
 *         else:
 *                raise Exception('can not handle type of %s' % (args,))             # <<<<<<<<<<<<<<
 * 
 *     def WriteToFile(self, bytes in_0 ):
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_can_not_handle_type_of_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pykeyvi.pyx":1027
 *         del v1
 * 
 *     def __init__(self, *args , **kwargs):             # <<<<<<<<<<<<<<
 *         if not args:
 *              self._init_0(*args)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1037
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_15WriteToFile(PyObject *__pyx_v_self, PyObject *__pyx_v_in_0) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("WriteToFile (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_0), (&PyBytes_Type), 1, "in_0", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_14WriteToFile(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), ((PyObject*)__pyx_v_in_0));

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_14WriteToFile(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_in_0) {
  const char *__pyx_v_input_in_0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  const char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("WriteToFile", 0);

  /* "pykeyvi.pyx":1038
 * 
 *     def WriteToFile(self, bytes in_0 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'             # <<<<<<<<<<<<<<
 *         cdef const_char * input_in_0 = <const_char *> in_0
 *         self.inst.get().WriteToFile(input_in_0)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyBytes_Check(__pyx_v_in_0); 
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_arg_in_0_wrong_type);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "pykeyvi.pyx":1039
 *     def WriteToFile(self, bytes in_0 ):
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_in_0); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_input_in_0 = ((const char *)__pyx_t_2);

  /* "pykeyvi.pyx":1040
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 *         self.inst.get().WriteToFile(input_in_0)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_v_self->inst.get()->WriteToFile(__pyx_v_input_in_0);

  /* "pykeyvi.pyx":1037
 *                raise Exception('can not handle type of %s' % (args,))
 * 
 *     def WriteToFile(self, bytes in_0 ):             # <<<<<<<<<<<<<<
 *         assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *         cdef const_char * input_in_0 = <const_char *> in_0
 */

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

/* "pykeyvi.pyx":1042
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_16__enter__(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_16__enter__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pykeyvi.pyx":1043
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":1042
 *         self.inst.get().WriteToFile(input_in_0)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":1046
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,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_type)) != 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("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_18__exit__(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_18__exit__(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pykeyvi.pyx":1047
 * 
 *     def __exit__(self, type, value, traceback):
 *         self.Compile()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __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;

  /* "pykeyvi.pyx":1046
 * 
 * 
 *     def __exit__(self, type, value, traceback):             # <<<<<<<<<<<<<<
 *         self.Compile()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1050
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_21Compile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Compile (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Compile", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_20Compile(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_20Compile(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_args) {
  void *__pyx_v_callback;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("Compile", 0);

  /* "pykeyvi.pyx":1051
 * 
 *     def Compile(self, *args):
 *         if not args:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 self.inst.get().Compile()
 */
  __pyx_t_1 = (__pyx_v_args != Py_None) && (PyTuple_GET_SIZE(__pyx_v_args) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "pykeyvi.pyx":1052
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "pykeyvi.pyx":1053
 *         if not args:
 *             with nogil:
 *                 self.inst.get().Compile()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
          __pyx_v_self->inst.get()->Compile();
        }

        /* "pykeyvi.pyx":1052
 *     def Compile(self, *args):
 *         if not args:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 self.inst.get().Compile()
 *             return
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pykeyvi.pyx":1054
 *             with nogil:
 *                 self.inst.get().Compile()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef void* callback = <void*> args[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pykeyvi.pyx":1056
 *             return
 * 
 *         cdef void* callback = <void*> args[0]             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)
 */
  __pyx_v_callback = ((void *)PyTuple_GET_ITEM(__pyx_v_args, 0));

  /* "pykeyvi.pyx":1057
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "pykeyvi.pyx":1058
 *         cdef void* callback = <void*> args[0]
 *         with nogil:
 *             self.inst.get().Compile(callback_wrapper, callback)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_self->inst.get()->Compile(__pyx_f_7pykeyvi_callback_wrapper, __pyx_v_callback);
      }

      /* "pykeyvi.pyx":1057
 * 
 *         cdef void* callback = <void*> args[0]
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.inst.get().Compile(callback_wrapper, callback)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "pykeyvi.pyx":1050
 * 
 * 
 *     def Compile(self, *args):             # <<<<<<<<<<<<<<
 *         if not args:
 *             with nogil:
 */

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

/* "pykeyvi.pyx":1061
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_23SetManifest(PyObject *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SetManifest (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_22SetManifest(((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)__pyx_v_self), ((PyObject *)__pyx_v_manifest));

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

static PyObject *__pyx_pf_7pykeyvi_28CompletionDictionaryCompiler_22SetManifest(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *__pyx_v_self, PyObject *__pyx_v_manifest) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  const char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SetManifest", 0);

  /* "pykeyvi.pyx":1062
 * 
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)             # <<<<<<<<<<<<<<
 *         self.inst.get().SetManifestFromString(m)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_manifest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_manifest);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_manifest);
    __Pyx_GIVEREF(__pyx_v_manifest);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pykeyvi.pyx":1063
 *     def SetManifest(self, manifest):
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_m); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->inst.get()->SetManifestFromString(__pyx_t_5);

  /* "pykeyvi.pyx":1061
 * 
 * 
 *     def SetManifest(self, manifest):             # <<<<<<<<<<<<<<
 *         m = json.dumps(manifest)
 *         self.inst.get().SetManifestFromString(m)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pykeyvi.CompletionDictionaryCompiler.SetManifest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pykeyvi.pyx":1067
 * 
 * # definition for all compilers
 * cdef void callback_wrapper(size_t a, size_t b, void* py_callback) with gil:             # <<<<<<<<<<<<<<
 *     (<object>py_callback)(a, b)
 * 
 */

static void __pyx_f_7pykeyvi_callback_wrapper(size_t __pyx_v_a, size_t __pyx_v_b, void *__pyx_v_py_callback) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("callback_wrapper", 0);

  /* "pykeyvi.pyx":1068
 * # definition for all compilers
 * cdef void callback_wrapper(size_t a, size_t b, void* py_callback) with gil:
 *     (<object>py_callback)(a, b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_b); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_callback));
  __pyx_t_4 = ((PyObject *)__pyx_v_py_callback); __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":1067
 * 
 * # definition for all compilers
 * cdef void callback_wrapper(size_t a, size_t b, void* py_callback) with gil:             # <<<<<<<<<<<<<<
 *     (<object>py_callback)(a, b)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("pykeyvi.callback_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "pykeyvi.pyx":1095
 *     #    self.it = it
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_13MatchIterator_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_13MatchIterator_1__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_13MatchIterator___iter__(((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_v_self));

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

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

  /* "pykeyvi.pyx":1096
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     #def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pykeyvi.pyx":1095
 *     #    self.it = it
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pykeyvi.pyx":1104
 *     #    del self.end
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         # This works correctly by using "*it" and "*end" in the code,
 *         #if  co.dereference( self.it ) == co.dereference( self.end ) :
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pykeyvi_13MatchIterator_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pykeyvi_13MatchIterator_3__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pykeyvi_13MatchIterator_2__next__(((struct __pyx_obj_7pykeyvi_MatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pykeyvi_13MatchIterator_2__next__(struct __pyx_obj_7pykeyvi_MatchIterator *__pyx_v_self) {
  keyvi::dictionary::Match *__pyx_v__r;
  struct __pyx_obj_7pykeyvi_Match *__pyx_v_py_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pykeyvi.pyx":1107
 *         # This works correctly by using "*it" and "*end" in the code,
 *         #if  co.dereference( self.it ) == co.dereference( self.end ) :
 *         if  self.it == self.end:             # <<<<<<<<<<<<<<
 * 
 *             raise StopIteration()
 */
  __pyx_t_1 = ((__pyx_v_self->it == __pyx_v_self->end) != 0);
  if (__pyx_t_1) {

    /* "pykeyvi.pyx":1109
 *         if  self.it == self.end:
 * 
 *             raise StopIteration()             # <<<<<<<<<<<<<<
 *         cdef _Match * _r = new _Match(co.dereference( self.it ))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pykeyvi.pyx":1110
 * 
 *             raise StopIteration()
 *         cdef _Match * _r = new _Match(co.dereference( self.it ))             # <<<<<<<<<<<<<<
 * 
 *         # This also does the expected thing.
 */
  __pyx_v__r = new keyvi::dictionary::Match((*__pyx_v_self->it));

  /* "pykeyvi.pyx":1113
 * 
 *         # This also does the expected thing.
 *         co.preincrement( self.it )             # <<<<<<<<<<<<<<
 * 
 *         cdef Match py_result = Match.__new__(Match)
 */
  (++__pyx_v_self->it);

  /* "pykeyvi.pyx":1115
 *         co.preincrement( self.it )
 * 
 *         cdef Match py_result = Match.__new__(Match)             # <<<<<<<<<<<<<<
 *         py_result.inst = shared_ptr[_Match](_r)
 * 
 */
  __pyx_t_2 = __pyx_tp_new_7pykeyvi_Match(((PyTypeObject *)((PyObject*)__pyx_ptype_7pykeyvi_Match)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pykeyvi_Match)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_py_result = ((struct __pyx_obj_7pykeyvi_Match *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pykeyvi.pyx":1116
 * 
 *         cdef Match py_result = Match.__new__(Match)
 *         py_result.inst = shared_ptr[_Match](_r)             # <<<<<<<<<<<<<<
 * 
 *         return py_result
 */
  __pyx_v_py_result->inst = boost::shared_ptr<keyvi::dictionary::Match> (__pyx_v__r);

  /* "pykeyvi.pyx":1118
 *         py_result.inst = shared_ptr[_Match](_r)
 * 
 *         return py_result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_py_result));
  __pyx_r = ((PyObject *)__pyx_v_py_result);
  goto __pyx_L0;

  /* "pykeyvi.pyx":1104
 *     #    del self.end
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         # This works correctly by using "*it" and "*end" in the code,
 *         #if  co.dereference( self.it ) == co.dereference( self.end ) :
 */

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

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_")
 * cdef string __pyx_convert_string_from_py_(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_", 0);

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_(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_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __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_")
 * cdef string __pyx_convert_string_from_py_(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_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":30
 * 
 * @cname("__pyx_convert_string_to_py_")
 * cdef object __pyx_convert_string_to_py_(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * 
 */

static PyObject *__pyx_convert_string_to_py_(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_to_py_", 0);

  /* "string.to_py":31
 * @cname("__pyx_convert_string_to_py_")
 * cdef object __pyx_convert_string_to_py_(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":30
 * 
 * @cname("__pyx_convert_string_to_py_")
 * cdef object __pyx_convert_string_to_py_(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_string_to_py_", __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_7pykeyvi_JsonDictionaryMerger(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::JsonDictionaryMerger> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_JsonDictionaryMerger(PyObject *o) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *p = (struct __pyx_obj_7pykeyvi_JsonDictionaryMerger *)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_7pykeyvi_20JsonDictionaryMerger_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_JsonDictionaryMerger[] = {
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_3_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_5_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_7_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"Merge", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_11Merge, METH_O, 0},
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_13Add, METH_O, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_20JsonDictionaryMerger_15SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_JsonDictionaryMerger = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.JsonDictionaryMerger", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_JsonDictionaryMerger), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_JsonDictionaryMerger, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_JsonDictionaryMerger, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_20JsonDictionaryMerger_9__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_JsonDictionaryMerger, /*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_7pykeyvi_StringDictionaryCompiler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::StringDictionaryCompiler> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_StringDictionaryCompiler(PyObject *o) {
  struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *p = (struct __pyx_obj_7pykeyvi_StringDictionaryCompiler *)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_7pykeyvi_24StringDictionaryCompiler_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_mp_ass_subscript_7pykeyvi_StringDictionaryCompiler(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7pykeyvi_24StringDictionaryCompiler_13__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pykeyvi_StringDictionaryCompiler[] = {
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_3_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_5_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_7_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_11Add, METH_VARARGS|METH_KEYWORDS, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_15WriteToFile, METH_O, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_17__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_19__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"Compile", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_21Compile, METH_VARARGS|METH_KEYWORDS, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_24StringDictionaryCompiler_23SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyMappingMethods __pyx_tp_as_mapping_StringDictionaryCompiler = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_7pykeyvi_StringDictionaryCompiler, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pykeyvi_StringDictionaryCompiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.StringDictionaryCompiler", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_StringDictionaryCompiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_StringDictionaryCompiler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StringDictionaryCompiler, /*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_7pykeyvi_StringDictionaryCompiler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_24StringDictionaryCompiler_9__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_StringDictionaryCompiler, /*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_7pykeyvi_JsonDictionaryCompiler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompiler> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_JsonDictionaryCompiler(PyObject *o) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *p = (struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler *)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_7pykeyvi_22JsonDictionaryCompiler_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_mp_ass_subscript_7pykeyvi_JsonDictionaryCompiler(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_13__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pykeyvi_JsonDictionaryCompiler[] = {
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_3Add, METH_VARARGS|METH_KEYWORDS, 0},
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_5_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_7_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_9_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_15WriteToFile, METH_O, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_17__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_19__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"Compile", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_21Compile, METH_VARARGS|METH_KEYWORDS, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_22JsonDictionaryCompiler_23SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyMappingMethods __pyx_tp_as_mapping_JsonDictionaryCompiler = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_7pykeyvi_JsonDictionaryCompiler, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pykeyvi_JsonDictionaryCompiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.JsonDictionaryCompiler", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_JsonDictionaryCompiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_JsonDictionaryCompiler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_JsonDictionaryCompiler, /*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_7pykeyvi_JsonDictionaryCompiler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_22JsonDictionaryCompiler_11__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_JsonDictionaryCompiler, /*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_7pykeyvi_Dictionary(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_Dictionary *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_Dictionary *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::Dictionary> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_Dictionary(PyObject *o) {
  struct __pyx_obj_7pykeyvi_Dictionary *p = (struct __pyx_obj_7pykeyvi_Dictionary *)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_7pykeyvi_10Dictionary_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pykeyvi_Dictionary(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pykeyvi_Dictionary[] = {
  {"LookupText", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_3LookupText, METH_O, 0},
  {"Lookup", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_5Lookup, METH_O, 0},
  {"_GetNear_0", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_7_GetNear_0, METH_VARARGS|METH_KEYWORDS, 0},
  {"_GetNear_1", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_9_GetNear_1, METH_VARARGS|METH_KEYWORDS, 0},
  {"GetNear", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_11GetNear, METH_VARARGS|METH_KEYWORDS, 0},
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_13_init_0, METH_O, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_15_init_1, METH_VARARGS|METH_KEYWORDS, 0},
  {"Get", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_19Get, METH_O, 0},
  {"get", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_21get, METH_VARARGS|METH_KEYWORDS, 0},
  {"_key_iterator_wrapper", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_29_key_iterator_wrapper, METH_O, 0},
  {"_value_iterator_wrapper", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_32_value_iterator_wrapper, METH_O, 0},
  {"_item_iterator_wrapper", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_35_item_iterator_wrapper, METH_O, 0},
  {"GetAllKeys", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_38GetAllKeys, METH_NOARGS, 0},
  {"GetAllValues", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_40GetAllValues, METH_NOARGS, 0},
  {"GetAllItems", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_42GetAllItems, METH_NOARGS, 0},
  {"GetManifest", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_44GetManifest, METH_NOARGS, 0},
  {"GetStatistics", (PyCFunction)__pyx_pw_7pykeyvi_10Dictionary_46GetStatistics, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Dictionary = {
  __pyx_pw_7pykeyvi_10Dictionary_25__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pykeyvi_Dictionary, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_7pykeyvi_10Dictionary_23__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Dictionary = {
  __pyx_pw_7pykeyvi_10Dictionary_25__len__, /*mp_length*/
  __pyx_pw_7pykeyvi_10Dictionary_27__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pykeyvi_Dictionary = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.Dictionary", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_Dictionary), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_Dictionary, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Dictionary, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Dictionary, /*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_7pykeyvi_Dictionary, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_10Dictionary_17__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_Dictionary, /*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_7pykeyvi_FsaTransform(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_FsaTransform *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_FsaTransform *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::transform::FsaTransform> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_FsaTransform(PyObject *o) {
  struct __pyx_obj_7pykeyvi_FsaTransform *p = (struct __pyx_obj_7pykeyvi_FsaTransform *)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_7pykeyvi_12FsaTransform_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_FsaTransform[] = {
  {"Normalize", (PyCFunction)__pyx_pw_7pykeyvi_12FsaTransform_3Normalize, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_FsaTransform = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.FsaTransform", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_FsaTransform), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_FsaTransform, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_FsaTransform, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_12FsaTransform_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_FsaTransform, /*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_7pykeyvi_PrefixCompletion(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_PrefixCompletion *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_PrefixCompletion *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::completion::PrefixCompletion> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_PrefixCompletion(PyObject *o) {
  struct __pyx_obj_7pykeyvi_PrefixCompletion *p = (struct __pyx_obj_7pykeyvi_PrefixCompletion *)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_7pykeyvi_16PrefixCompletion_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_PrefixCompletion[] = {
  {"GetFuzzyCompletions", (PyCFunction)__pyx_pw_7pykeyvi_16PrefixCompletion_3GetFuzzyCompletions, METH_VARARGS|METH_KEYWORDS, 0},
  {"GetCompletions", (PyCFunction)__pyx_pw_7pykeyvi_16PrefixCompletion_7GetCompletions, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_PrefixCompletion = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.PrefixCompletion", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_PrefixCompletion), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_PrefixCompletion, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_PrefixCompletion, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_16PrefixCompletion_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_PrefixCompletion, /*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_7pykeyvi_ForwardBackwardCompletion(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::completion::ForwardBackwardCompletion> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_ForwardBackwardCompletion(PyObject *o) {
  struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *p = (struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion *)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_7pykeyvi_25ForwardBackwardCompletion_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_ForwardBackwardCompletion[] = {
  {"_GetCompletions_0", (PyCFunction)__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_3_GetCompletions_0, METH_O, 0},
  {"_GetCompletions_1", (PyCFunction)__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_5_GetCompletions_1, METH_VARARGS|METH_KEYWORDS, 0},
  {"GetCompletions", (PyCFunction)__pyx_pw_7pykeyvi_25ForwardBackwardCompletion_7GetCompletions, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_ForwardBackwardCompletion = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.ForwardBackwardCompletion", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_ForwardBackwardCompletion), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_ForwardBackwardCompletion, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_ForwardBackwardCompletion, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_25ForwardBackwardCompletion_9__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_ForwardBackwardCompletion, /*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_7pykeyvi_loading_strategy_types(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;
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_loading_strategy_types(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyTypeObject __pyx_type_7pykeyvi_loading_strategy_types = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.loading_strategy_types", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_loading_strategy_types), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_loading_strategy_types, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_loading_strategy_types, /*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_7pykeyvi_JsonDictionaryCompilerSmallData(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::JsonDictionaryCompilerSmallData> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_JsonDictionaryCompilerSmallData(PyObject *o) {
  struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *p = (struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData *)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_7pykeyvi_31JsonDictionaryCompilerSmallData_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_mp_ass_subscript_7pykeyvi_JsonDictionaryCompilerSmallData(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_3__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pykeyvi_JsonDictionaryCompilerSmallData[] = {
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_5_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_7_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_9_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_13WriteToFile, METH_O, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_15__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_17__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_19Add, METH_VARARGS|METH_KEYWORDS, 0},
  {"Compile", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_21Compile, METH_VARARGS|METH_KEYWORDS, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_23SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyMappingMethods __pyx_tp_as_mapping_JsonDictionaryCompilerSmallData = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_7pykeyvi_JsonDictionaryCompilerSmallData, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pykeyvi_JsonDictionaryCompilerSmallData = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.JsonDictionaryCompilerSmallData", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_JsonDictionaryCompilerSmallData), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_JsonDictionaryCompilerSmallData, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_JsonDictionaryCompilerSmallData, /*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_7pykeyvi_JsonDictionaryCompilerSmallData, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_31JsonDictionaryCompilerSmallData_11__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_JsonDictionaryCompilerSmallData, /*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_7pykeyvi_MultiWordCompletion(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_MultiWordCompletion *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_MultiWordCompletion *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::completion::MultiWordCompletion> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_MultiWordCompletion(PyObject *o) {
  struct __pyx_obj_7pykeyvi_MultiWordCompletion *p = (struct __pyx_obj_7pykeyvi_MultiWordCompletion *)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_7pykeyvi_19MultiWordCompletion_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_MultiWordCompletion[] = {
  {"_GetCompletions_0", (PyCFunction)__pyx_pw_7pykeyvi_19MultiWordCompletion_5_GetCompletions_0, METH_O, 0},
  {"_GetCompletions_1", (PyCFunction)__pyx_pw_7pykeyvi_19MultiWordCompletion_7_GetCompletions_1, METH_VARARGS|METH_KEYWORDS, 0},
  {"GetCompletions", (PyCFunction)__pyx_pw_7pykeyvi_19MultiWordCompletion_9GetCompletions, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_MultiWordCompletion = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.MultiWordCompletion", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_MultiWordCompletion), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_MultiWordCompletion, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_MultiWordCompletion, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_19MultiWordCompletion_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_MultiWordCompletion, /*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_7pykeyvi_PredictiveCompression(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_PredictiveCompression *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_PredictiveCompression *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::compression::PredictiveCompression> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_PredictiveCompression(PyObject *o) {
  struct __pyx_obj_7pykeyvi_PredictiveCompression *p = (struct __pyx_obj_7pykeyvi_PredictiveCompression *)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_7pykeyvi_21PredictiveCompression_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_PredictiveCompression[] = {
  {"Compress", (PyCFunction)__pyx_pw_7pykeyvi_21PredictiveCompression_3Compress, METH_O, 0},
  {"Uncompress", (PyCFunction)__pyx_pw_7pykeyvi_21PredictiveCompression_7Uncompress, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_PredictiveCompression = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.PredictiveCompression", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_PredictiveCompression), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_PredictiveCompression, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_PredictiveCompression, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_21PredictiveCompression_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_PredictiveCompression, /*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_7pykeyvi_KeyOnlyDictionaryGenerator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryGenerator> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_KeyOnlyDictionaryGenerator(PyObject *o) {
  struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *p = (struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator *)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_7pykeyvi_26KeyOnlyDictionaryGenerator_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_KeyOnlyDictionaryGenerator[] = {
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_5Add, METH_O, 0},
  {"CloseFeeding", (PyCFunction)__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_7CloseFeeding, METH_NOARGS, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_9WriteToFile, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_KeyOnlyDictionaryGenerator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.KeyOnlyDictionaryGenerator", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryGenerator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_KeyOnlyDictionaryGenerator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_KeyOnlyDictionaryGenerator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_26KeyOnlyDictionaryGenerator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_KeyOnlyDictionaryGenerator, /*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_7pykeyvi_KeyOnlyDictionaryCompiler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::KeyOnlyDictionaryCompiler> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_KeyOnlyDictionaryCompiler(PyObject *o) {
  struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *p = (struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler *)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_7pykeyvi_25KeyOnlyDictionaryCompiler_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_KeyOnlyDictionaryCompiler[] = {
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_3_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_5_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_7_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_11Add, METH_O, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_13WriteToFile, METH_O, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_15__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_17__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"Compile", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_19Compile, METH_VARARGS|METH_KEYWORDS, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_21SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_KeyOnlyDictionaryCompiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.KeyOnlyDictionaryCompiler", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_KeyOnlyDictionaryCompiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_KeyOnlyDictionaryCompiler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_KeyOnlyDictionaryCompiler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_25KeyOnlyDictionaryCompiler_9__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_KeyOnlyDictionaryCompiler, /*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_7pykeyvi_Match(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_Match *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_Match *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::Match> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_Match(PyObject *o) {
  struct __pyx_obj_7pykeyvi_Match *p = (struct __pyx_obj_7pykeyvi_Match *)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_7pykeyvi_5Match_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_Match[] = {
  {"SetEnd", (PyCFunction)__pyx_pw_7pykeyvi_5Match_3SetEnd, METH_O, 0},
  {"GetStart", (PyCFunction)__pyx_pw_7pykeyvi_5Match_5GetStart, METH_NOARGS, 0},
  {"GetScore", (PyCFunction)__pyx_pw_7pykeyvi_5Match_7GetScore, METH_NOARGS, 0},
  {"SetMatchedString", (PyCFunction)__pyx_pw_7pykeyvi_5Match_9SetMatchedString, METH_O, 0},
  {"GetValueAsString", (PyCFunction)__pyx_pw_7pykeyvi_5Match_11GetValueAsString, METH_NOARGS, 0},
  {"IsEmpty", (PyCFunction)__pyx_pw_7pykeyvi_5Match_13IsEmpty, METH_NOARGS, 0},
  {"SetScore", (PyCFunction)__pyx_pw_7pykeyvi_5Match_15SetScore, METH_O, 0},
  {"GetRawValueAsString", (PyCFunction)__pyx_pw_7pykeyvi_5Match_17GetRawValueAsString, METH_NOARGS, 0},
  {"SetStart", (PyCFunction)__pyx_pw_7pykeyvi_5Match_19SetStart, METH_O, 0},
  {"GetEnd", (PyCFunction)__pyx_pw_7pykeyvi_5Match_21GetEnd, METH_NOARGS, 0},
  {"__copy__", (PyCFunction)__pyx_pw_7pykeyvi_5Match_23__copy__, METH_NOARGS, 0},
  {"__deepcopy__", (PyCFunction)__pyx_pw_7pykeyvi_5Match_25__deepcopy__, METH_O, 0},
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_5Match_27_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_5Match_29_init_1, METH_O, 0},
  {"GetMatchedString", (PyCFunction)__pyx_pw_7pykeyvi_5Match_33GetMatchedString, METH_NOARGS, 0},
  {"GetAttribute", (PyCFunction)__pyx_pw_7pykeyvi_5Match_35GetAttribute, METH_O, 0},
  {"SetAttribute", (PyCFunction)__pyx_pw_7pykeyvi_5Match_37SetAttribute, METH_VARARGS|METH_KEYWORDS, 0},
  {"GetValue", (PyCFunction)__pyx_pw_7pykeyvi_5Match_39GetValue, METH_NOARGS, __pyx_doc_7pykeyvi_5Match_38GetValue},
  {"dumps", (PyCFunction)__pyx_pw_7pykeyvi_5Match_41dumps, METH_NOARGS, 0},
  {"__SetRawValue", (PyCFunction)__pyx_pw_7pykeyvi_5Match_43__SetRawValue, METH_O, 0},
  {"loads", (PyCFunction)__pyx_pw_7pykeyvi_5Match_45loads, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_Match = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.Match", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_Match), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_Match, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7pykeyvi_Match, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_5Match_31__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_Match, /*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_7pykeyvi_CompletionDictionaryCompiler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)o);
  new((void*)&(p->inst)) boost::shared_ptr<keyvi::dictionary::CompletionDictionaryCompiler> ();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_CompletionDictionaryCompiler(PyObject *o) {
  struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *p = (struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler *)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_7pykeyvi_28CompletionDictionaryCompiler_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(&p->inst);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_mp_ass_subscript_7pykeyvi_CompletionDictionaryCompiler(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_3__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pykeyvi_CompletionDictionaryCompiler[] = {
  {"Add", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_5Add, METH_VARARGS|METH_KEYWORDS, 0},
  {"_init_0", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_7_init_0, METH_NOARGS, 0},
  {"_init_1", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_9_init_1, METH_O, 0},
  {"_init_2", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_11_init_2, METH_VARARGS|METH_KEYWORDS, 0},
  {"WriteToFile", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_15WriteToFile, METH_O, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_17__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_19__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"Compile", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_21Compile, METH_VARARGS|METH_KEYWORDS, 0},
  {"SetManifest", (PyCFunction)__pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_23SetManifest, METH_O, 0},
  {0, 0, 0, 0}
};

static PyMappingMethods __pyx_tp_as_mapping_CompletionDictionaryCompiler = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_7pykeyvi_CompletionDictionaryCompiler, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pykeyvi_CompletionDictionaryCompiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.CompletionDictionaryCompiler", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_CompletionDictionaryCompiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_CompletionDictionaryCompiler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CompletionDictionaryCompiler, /*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_7pykeyvi_CompletionDictionaryCompiler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pykeyvi_28CompletionDictionaryCompiler_13__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi_CompletionDictionaryCompiler, /*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_7pykeyvi_MatchIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pykeyvi_MatchIterator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pykeyvi_MatchIterator *)o);
  new((void*)&(p->it)) keyvi::dictionary::MatchIterator();
  new((void*)&(p->end)) keyvi::dictionary::MatchIterator();
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi_MatchIterator(PyObject *o) {
  struct __pyx_obj_7pykeyvi_MatchIterator *p = (struct __pyx_obj_7pykeyvi_MatchIterator *)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
  __Pyx_call_destructor(&p->it);
  __Pyx_call_destructor(&p->end);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pykeyvi_MatchIterator[] = {
  {"__next__", (PyCFunction)__pyx_pw_7pykeyvi_13MatchIterator_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pykeyvi_MatchIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.MatchIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi_MatchIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi_MatchIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pykeyvi_13MatchIterator_1__iter__, /*tp_iter*/
  __pyx_pw_7pykeyvi_13MatchIterator_3__next__, /*tp_iternext*/
  __pyx_methods_7pykeyvi_MatchIterator, /*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_7pykeyvi_MatchIterator, /*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_7pykeyvi___pyx_scope_struct___init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct___init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct___init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct___init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct___init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct___init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct___init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2));
    (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_7pykeyvi___pyx_scope_struct___init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct___init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct___init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct___init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct___init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct___init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct___init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct___init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct___init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct___init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct___init_2, /*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_7pykeyvi___pyx_scope_struct___init_2, /*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_7pykeyvi___pyx_scope_struct_1_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_1_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_1_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_1_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_1_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_2_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_2_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_2_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_2_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct___init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_2_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_3___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_3___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___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_7pykeyvi___pyx_scope_struct_3___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_3___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_3___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___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_7pykeyvi___pyx_scope_struct_3___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_3___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_3___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_3___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_3___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_3___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_3___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_3___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_3___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_3___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___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_7pykeyvi___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_7pykeyvi___pyx_scope_struct_4_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_4_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_4_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_4_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_4_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_4_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_5_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_5_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_5_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_3___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_5_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct_6__init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_6__init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_6__init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_6__init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_6__init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct_6__init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2));
    (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_7pykeyvi___pyx_scope_struct_6__init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_6__init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_6__init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct_6__init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_6__init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_6__init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_6__init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_6__init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_6__init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_6__init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_6__init_2, /*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_7pykeyvi___pyx_scope_struct_6__init_2, /*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_7pykeyvi___pyx_scope_struct_7_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_7_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_7_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_7_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_7_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_7_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_7_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_8_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_8_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_8_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_8_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_6__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_8_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_9___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_9___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___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_7pykeyvi___pyx_scope_struct_9___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_9___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_9___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___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_7pykeyvi___pyx_scope_struct_9___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_9___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_9___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_9___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_9___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_9___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_9___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_9___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_9___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_9___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___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_7pykeyvi___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_7pykeyvi___pyx_scope_struct_10_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_10_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_10_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_10_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_10_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_10_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_10_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_10_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_10_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_10_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_10_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_10_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_10_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_10_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_10_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_10_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_10_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_11_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_11_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_11_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_11_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_11_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_11_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_11_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_11_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_11_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_9___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_11_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_11_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_11_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_11_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_11_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_11_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_11_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct_12__init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_12__init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_12__init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_12__init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_12__init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct_12__init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2));
    (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_7pykeyvi___pyx_scope_struct_12__init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_12__init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_12__init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct_12__init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_12__init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_12__init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_12__init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_12__init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_12__init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_12__init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_12__init_2, /*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_7pykeyvi___pyx_scope_struct_12__init_2, /*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_7pykeyvi___pyx_scope_struct_13_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_13_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_13_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_13_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_13_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_13_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_13_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_13_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_13_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_13_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_14_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_14_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_14_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_12__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_14_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_15___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_15___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_15___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_15___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_15___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_15___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___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_7pykeyvi___pyx_scope_struct_15___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_15___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_15___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_15___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_15___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_15___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_15___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_15___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_15___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_15___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_15___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_7pykeyvi___pyx_scope_struct_15___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_7pykeyvi___pyx_scope_struct_16_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_16_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_16_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_16_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_16_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_16_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_16_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_16_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_16_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_16_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_16_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_16_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_16_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_16_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_16_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_16_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_17_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_17_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_17_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_17_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_15___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_17_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_17_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *__pyx_freelist_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper[--__pyx_freecount_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper));
    (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_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_iterator);
  Py_CLEAR(p->__pyx_v_m);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper[__pyx_freecount_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)o;
  if (p->__pyx_v_iterator) {
    e = (*v)(p->__pyx_v_iterator, a); if (e) return e;
  }
  if (p->__pyx_v_m) {
    e = (*v)(p->__pyx_v_m, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper *)o;
  tmp = ((PyObject*)p->__pyx_v_iterator);
  p->__pyx_v_iterator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_m);
  p->__pyx_v_m = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pykeyvi_Dictionary *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_18__key_iterator_wrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *__pyx_freelist_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper[--__pyx_freecount_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper));
    (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_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_iterator);
  Py_CLEAR(p->__pyx_v_m);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper[__pyx_freecount_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)o;
  if (p->__pyx_v_iterator) {
    e = (*v)(p->__pyx_v_iterator, a); if (e) return e;
  }
  if (p->__pyx_v_m) {
    e = (*v)(p->__pyx_v_m, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper *)o;
  tmp = ((PyObject*)p->__pyx_v_iterator);
  p->__pyx_v_iterator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_m);
  p->__pyx_v_m = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pykeyvi_Dictionary *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_19__value_iterator_wrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *__pyx_freelist_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper[--__pyx_freecount_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper));
    (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_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_iterator);
  Py_CLEAR(p->__pyx_v_m);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper[__pyx_freecount_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)o;
  if (p->__pyx_v_iterator) {
    e = (*v)(p->__pyx_v_iterator, a); if (e) return e;
  }
  if (p->__pyx_v_m) {
    e = (*v)(p->__pyx_v_m, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper *)o;
  tmp = ((PyObject*)p->__pyx_v_iterator);
  p->__pyx_v_iterator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_m);
  p->__pyx_v_m = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pykeyvi_Dictionary *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_20__item_iterator_wrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper, /*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_7pykeyvi___pyx_scope_struct_21__init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct_21__init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_21__init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_21__init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_21__init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_21__init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct_21__init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2));
    (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_7pykeyvi___pyx_scope_struct_21__init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_21__init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_21__init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct_21__init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_21__init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_21__init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_21__init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_21__init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_21__init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_21__init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_21__init_2, /*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_7pykeyvi___pyx_scope_struct_21__init_2, /*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_7pykeyvi___pyx_scope_struct_22_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_22_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_22_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_22_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_22_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_22_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_22_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_22_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_22_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_22_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_22_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_22_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_22_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_22_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_22_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_23_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_23_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_23_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_23_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_23_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_23_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_23_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_23_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_23_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_21__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_23_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_23_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_23_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_23_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_23_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_23_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_23_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_24___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_24___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_24___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_24___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_24___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_24___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___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_7pykeyvi___pyx_scope_struct_24___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_24___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_24___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_24___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_24___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_24___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_24___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_24___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_24___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_24___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_24___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_7pykeyvi___pyx_scope_struct_24___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_7pykeyvi___pyx_scope_struct_25_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_25_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_25_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_25_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_25_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_25_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_25_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_25_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_25_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_25_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_25_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_25_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_25_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_25_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_25_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_26_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_26_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_26_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_26_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_26_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_26_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_26_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_26_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_26_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_26_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_26_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_26_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_24___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_26_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_26_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_26_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_26_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_26_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_26_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_26_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct_27__init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_27__init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_27__init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_27__init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_27__init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct_27__init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2));
    (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_7pykeyvi___pyx_scope_struct_27__init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_27__init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_27__init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct_27__init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_27__init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_27__init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_27__init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_27__init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_27__init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_27__init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_27__init_2, /*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_7pykeyvi___pyx_scope_struct_27__init_2, /*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_7pykeyvi___pyx_scope_struct_28_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_28_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_28_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_28_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_28_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_28_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_28_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_28_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_28_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_28_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_28_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_28_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_28_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_28_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_28_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_28_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_28_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_28_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_28_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_28_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_29_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_29_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_29_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_29_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_29_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_29_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_29_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_29_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_29_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_27__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_29_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_29_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_29_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_29_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_29_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_29_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_29_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_30___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_30___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_30___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_30___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_30___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_30___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___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_7pykeyvi___pyx_scope_struct_30___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_30___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_30___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_30___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_30___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_30___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_30___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_30___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_30___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_30___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_30___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_7pykeyvi___pyx_scope_struct_30___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_7pykeyvi___pyx_scope_struct_31_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_31_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_31_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_31_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_31_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_31_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_31_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_31_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_31_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_31_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_31_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_31_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_31_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_31_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_31_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_31_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_31_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_31_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_31_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_31_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_32_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_32_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_32_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_32_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_32_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_32_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_32_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_32_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_32_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_32_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_32_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_32_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_30___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_32_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_32_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_32_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_32_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_32_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_32_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_32_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *__pyx_freelist_7pykeyvi___pyx_scope_struct_33__init_2[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_33__init_2 = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_33__init_2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_33__init_2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_33__init_2[--__pyx_freecount_7pykeyvi___pyx_scope_struct_33__init_2];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2));
    (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_7pykeyvi___pyx_scope_struct_33__init_2(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_value_store_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_33__init_2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_33__init_2[__pyx_freecount_7pykeyvi___pyx_scope_struct_33__init_2++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_33__init_2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)o;
  if (p->__pyx_v_value_store_params) {
    e = (*v)(p->__pyx_v_value_store_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_33__init_2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)o;
  tmp = ((PyObject*)p->__pyx_v_value_store_params);
  p->__pyx_v_value_store_params = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_33__init_2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_33__init_2", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_33__init_2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_33__init_2, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_33__init_2, /*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_7pykeyvi___pyx_scope_struct_33__init_2, /*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_7pykeyvi___pyx_scope_struct_34_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_34_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_34_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_34_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_34_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_34_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_34_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_34_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_34_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_34_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_34_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_34_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_34_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_34_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_34_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_34_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_34_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_34_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_34_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_34_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_35_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_35_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_35_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_35_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_35_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_35_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_35_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_35_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_35_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_35_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_35_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_35_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_33__init_2 *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_35_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_35_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_35_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_35_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_35_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_35_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_35_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *__pyx_freelist_7pykeyvi___pyx_scope_struct_36___init__[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_36___init__ = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_36___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_36___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_36___init__[--__pyx_freecount_7pykeyvi___pyx_scope_struct_36___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___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_7pykeyvi___pyx_scope_struct_36___init__(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_36___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_36___init__[__pyx_freecount_7pykeyvi___pyx_scope_struct_36___init__++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_36___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_36___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_36___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_36___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_36___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_36___init__, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_36___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_7pykeyvi___pyx_scope_struct_36___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_7pykeyvi___pyx_scope_struct_37_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_37_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_37_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_37_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_37_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_37_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_37_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_37_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_37_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_37_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_37_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_37_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_37_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_37_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_37_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_37_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_37_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_37_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_37_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_37_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *__pyx_freelist_7pykeyvi___pyx_scope_struct_38_genexpr[8];
static int __pyx_freecount_7pykeyvi___pyx_scope_struct_38_genexpr = 0;

static PyObject *__pyx_tp_new_7pykeyvi___pyx_scope_struct_38_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pykeyvi___pyx_scope_struct_38_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pykeyvi___pyx_scope_struct_38_genexpr[--__pyx_freecount_7pykeyvi___pyx_scope_struct_38_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_38_genexpr(PyObject *o) {
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pykeyvi___pyx_scope_struct_38_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr)))) {
    __pyx_freelist_7pykeyvi___pyx_scope_struct_38_genexpr[__pyx_freecount_7pykeyvi___pyx_scope_struct_38_genexpr++] = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_38_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pykeyvi___pyx_scope_struct_38_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7pykeyvi___pyx_scope_struct_36___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v);
  p->__pyx_v_v = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pykeyvi___pyx_scope_struct_38_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pykeyvi.__pyx_scope_struct_38_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pykeyvi___pyx_scope_struct_38_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pykeyvi___pyx_scope_struct_38_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pykeyvi___pyx_scope_struct_38_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7pykeyvi___pyx_scope_struct_38_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pykeyvi___pyx_scope_struct_38_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {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
    "pykeyvi",
    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_n_s_Compile, __pyx_k_Compile, sizeof(__pyx_k_Compile), 0, 0, 1, 1},
  {&__pyx_n_s_Dictionary__item_iterator_wrappe, __pyx_k_Dictionary__item_iterator_wrappe, sizeof(__pyx_k_Dictionary__item_iterator_wrappe), 0, 0, 1, 1},
  {&__pyx_n_s_Dictionary__key_iterator_wrapper, __pyx_k_Dictionary__key_iterator_wrapper, sizeof(__pyx_k_Dictionary__key_iterator_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_Dictionary__value_iterator_wrapp, __pyx_k_Dictionary__value_iterator_wrapp, sizeof(__pyx_k_Dictionary__value_iterator_wrapp), 0, 0, 1, 1},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_n_s_GetCompletions_0, __pyx_k_GetCompletions_0, sizeof(__pyx_k_GetCompletions_0), 0, 0, 1, 1},
  {&__pyx_n_s_GetCompletions_1, __pyx_k_GetCompletions_1, sizeof(__pyx_k_GetCompletions_1), 0, 0, 1, 1},
  {&__pyx_n_s_GetMatchedString, __pyx_k_GetMatchedString, sizeof(__pyx_k_GetMatchedString), 0, 0, 1, 1},
  {&__pyx_n_s_GetNear_0, __pyx_k_GetNear_0, sizeof(__pyx_k_GetNear_0), 0, 0, 1, 1},
  {&__pyx_n_s_GetNear_1, __pyx_k_GetNear_1, sizeof(__pyx_k_GetNear_1), 0, 0, 1, 1},
  {&__pyx_n_s_GetStatistics_locals_lambda, __pyx_k_GetStatistics_locals_lambda, sizeof(__pyx_k_GetStatistics_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_GetValue, __pyx_k_GetValue, sizeof(__pyx_k_GetValue), 0, 0, 1, 1},
  {&__pyx_n_s_JumpConsistentHashString, __pyx_k_JumpConsistentHashString, sizeof(__pyx_k_JumpConsistentHashString), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_SetEnd, __pyx_k_SetEnd, sizeof(__pyx_k_SetEnd), 0, 0, 1, 1},
  {&__pyx_n_s_SetMatchedString, __pyx_k_SetMatchedString, sizeof(__pyx_k_SetMatchedString), 0, 0, 1, 1},
  {&__pyx_n_s_SetRawValue, __pyx_k_SetRawValue, sizeof(__pyx_k_SetRawValue), 0, 0, 1, 1},
  {&__pyx_n_s_SetScore, __pyx_k_SetScore, sizeof(__pyx_k_SetScore), 0, 0, 1, 1},
  {&__pyx_n_s_SetStart, __pyx_k_SetStart, sizeof(__pyx_k_SetStart), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0},
  {&__pyx_kp_s_Unsupported_Value_Type, __pyx_k_Unsupported_Value_Type, sizeof(__pyx_k_Unsupported_Value_Type), 0, 0, 1, 0},
  {&__pyx_kp_s_Users_narek_projects_keyvi_pyke, __pyx_k_Users_narek_projects_keyvi_pyke, sizeof(__pyx_k_Users_narek_projects_keyvi_pyke), 0, 0, 1, 0},
  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
  {&__pyx_kp_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 0},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_kp_s_arg_end_wrong_type, __pyx_k_arg_end_wrong_type, sizeof(__pyx_k_arg_end_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_filename_wrong_type, __pyx_k_arg_filename_wrong_type, sizeof(__pyx_k_arg_filename_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_greedy_wrong_type, __pyx_k_arg_greedy_wrong_type, sizeof(__pyx_k_arg_greedy_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_in_0_wrong_type, __pyx_k_arg_in_0_wrong_type, sizeof(__pyx_k_arg_in_0_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_in_1_wrong_type, __pyx_k_arg_in_1_wrong_type, sizeof(__pyx_k_arg_in_1_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_m_wrong_type, __pyx_k_arg_m_wrong_type, sizeof(__pyx_k_arg_m_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_matched_string_wrong_type, __pyx_k_arg_matched_string_wrong_type, sizeof(__pyx_k_arg_matched_string_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_max_edit_distance_wrong_type, __pyx_k_arg_max_edit_distance_wrong_type, sizeof(__pyx_k_arg_max_edit_distance_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_memory_limit_wrong_type, __pyx_k_arg_memory_limit_wrong_type, sizeof(__pyx_k_arg_memory_limit_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_minimum_prefix_length_wrong, __pyx_k_arg_minimum_prefix_length_wrong, sizeof(__pyx_k_arg_minimum_prefix_length_wrong), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_score_wrong_type, __pyx_k_arg_score_wrong_type, sizeof(__pyx_k_arg_score_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_start_wrong_type, __pyx_k_arg_start_wrong_type, sizeof(__pyx_k_arg_start_wrong_type), 0, 0, 1, 0},
  {&__pyx_kp_s_arg_value_store_params_wrong_typ, __pyx_k_arg_value_store_params_wrong_typ, sizeof(__pyx_k_arg_value_store_params_wrong_typ), 0, 0, 1, 0},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_kp_s_can_not_handle_type_of_s, __pyx_k_can_not_handle_type_of_s, sizeof(__pyx_k_can_not_handle_type_of_s), 0, 0, 1, 0},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_default_os, __pyx_k_default_os, sizeof(__pyx_k_default_os), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_greedy, __pyx_k_greedy, sizeof(__pyx_k_greedy), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_0, __pyx_k_in_0, sizeof(__pyx_k_in_0), 0, 0, 1, 1},
  {&__pyx_n_s_in_1, __pyx_k_in_1, sizeof(__pyx_k_in_1), 0, 0, 1, 1},
  {&__pyx_n_s_init_0, __pyx_k_init_0, sizeof(__pyx_k_init_0), 0, 0, 1, 1},
  {&__pyx_n_s_init_1, __pyx_k_init_1, sizeof(__pyx_k_init_1), 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_2_locals_genexpr, __pyx_k_init_2_locals_genexpr, sizeof(__pyx_k_init_2_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_init___locals_genexpr, __pyx_k_init___locals_genexpr, sizeof(__pyx_k_init___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_input_in_0, __pyx_k_input_in_0, sizeof(__pyx_k_input_in_0), 0, 0, 1, 1},
  {&__pyx_n_s_item_iterator_wrapper, __pyx_k_item_iterator_wrapper, sizeof(__pyx_k_item_iterator_wrapper), 0, 0, 1, 1},
  {&__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_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_key_iterator_wrapper, __pyx_k_key_iterator_wrapper, sizeof(__pyx_k_key_iterator_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_lazy, __pyx_k_lazy, sizeof(__pyx_k_lazy), 0, 0, 1, 1},
  {&__pyx_n_s_lazy_no_readahead, __pyx_k_lazy_no_readahead, sizeof(__pyx_k_lazy_no_readahead), 0, 0, 1, 1},
  {&__pyx_n_s_lazy_no_readahead_value_part, __pyx_k_lazy_no_readahead_value_part, sizeof(__pyx_k_lazy_no_readahead_value_part), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_max_edit_distance, __pyx_k_max_edit_distance, sizeof(__pyx_k_max_edit_distance), 0, 0, 1, 1},
  {&__pyx_n_s_memory_limit, __pyx_k_memory_limit, sizeof(__pyx_k_memory_limit), 0, 0, 1, 1},
  {&__pyx_n_s_minimum_prefix_length, __pyx_k_minimum_prefix_length, sizeof(__pyx_k_minimum_prefix_length), 0, 0, 1, 1},
  {&__pyx_n_s_msgpack, __pyx_k_msgpack, sizeof(__pyx_k_msgpack), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_fields, __pyx_k_number_of_fields, sizeof(__pyx_k_number_of_fields), 0, 0, 1, 1},
  {&__pyx_n_s_populate, __pyx_k_populate, sizeof(__pyx_k_populate), 0, 0, 1, 1},
  {&__pyx_n_s_populate_key_part, __pyx_k_populate_key_part, sizeof(__pyx_k_populate_key_part), 0, 0, 1, 1},
  {&__pyx_n_s_populate_key_part_no_readahead_v, __pyx_k_populate_key_part_no_readahead_v, sizeof(__pyx_k_populate_key_part_no_readahead_v), 0, 0, 1, 1},
  {&__pyx_n_s_populate_lazy, __pyx_k_populate_lazy, sizeof(__pyx_k_populate_lazy), 0, 0, 1, 1},
  {&__pyx_n_s_py_result, __pyx_k_py_result, sizeof(__pyx_k_py_result), 0, 0, 1, 1},
  {&__pyx_n_s_pykeyvi, __pyx_k_pykeyvi, sizeof(__pyx_k_pykeyvi), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_serialized_match, __pyx_k_serialized_match, sizeof(__pyx_k_serialized_match), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_unserialized, __pyx_k_unserialized, sizeof(__pyx_k_unserialized), 0, 0, 1, 1},
  {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_value_iterator_wrapper, __pyx_k_value_iterator_wrapper, sizeof(__pyx_k_value_iterator_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_value_store_params, __pyx_k_value_store_params, sizeof(__pyx_k_value_store_params), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_filter = __Pyx_GetBuiltinName(__pyx_n_s_filter); if (!__pyx_builtin_filter) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "pykeyvi.pyx":86
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Merge((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pykeyvi.pyx":92
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "pykeyvi.pyx":139
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pykeyvi.pyx":141
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "pykeyvi.pyx":148
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pykeyvi.pyx":150
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pykeyvi.pyx":156
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "pykeyvi.pyx":194
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "pykeyvi.pyx":196
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pykeyvi.pyx":231
 *         assert isinstance(in_1, (bytes, unicode)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pykeyvi.pyx":233
 *             in_0 = in_0.encode('utf-8')
 *         if isinstance(in_1, unicode):
 *             in_1 = in_1.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<libcpp_string>in_1))
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "pykeyvi.pyx":239
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pykeyvi.pyx":276
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().LookupText((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pykeyvi.pyx":286
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().Lookup((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pykeyvi.pyx":297
 *         assert isinstance(minimum_prefix_length, (int, long)), 'arg minimum_prefix_length wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetNear((<libcpp_string>in_0), (<size_t>minimum_prefix_length))
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pykeyvi.pyx":310
 *         assert isinstance(greedy, (int, long)), 'arg greedy wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pykeyvi.pyx":330
 *         assert isinstance(filename, (bytes, unicode)), 'arg filename wrong type'
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename)))
 * 
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "pykeyvi.pyx":337
 *         assert in_1 in [0, 1, 2, 3, 4, 5, 6, 7], 'arg in_1 wrong type'
 *         if isinstance(filename, unicode):
 *             filename = filename.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst = shared_ptr[_Dictionary](new _Dictionary((<libcpp_string>filename), (<_loading_strategy_types>in_1)))
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pykeyvi.pyx":352
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().Get((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pykeyvi.pyx":361
 *     def get (self, key, default = None):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pykeyvi.pyx":374
 *     def __contains__(self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pykeyvi.pyx":385
 *     def __getitem__ (self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         assert isinstance(key, bytes), 'arg in_0 wrong type'
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pykeyvi.pyx":442
 *         return {k: json.loads(v) for k, v in filter(
 *             lambda kv: kv and isinstance(kv, list) and len(kv) > 1 and kv[1],
 *             [s.rstrip().split("\n") for s in py_result.split("\n\n")]             # <<<<<<<<<<<<<<
 *         )}
 * 
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pykeyvi.pyx":456
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Normalize((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pykeyvi.pyx":478
 *         assert isinstance(max_edit_distance, (int, long)), 'arg max_edit_distance wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetFuzzyCompletions((<libcpp_string>in_0), (<int>max_edit_distance))
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "pykeyvi.pyx":494
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "pykeyvi.pyx":512
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pykeyvi.pyx":523
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "pykeyvi.pyx":617
 * 
 *         if isinstance(key, unicode):
 *             key = key.encode('UTF-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string input_in_0 = <libcpp_string> key
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "pykeyvi.pyx":621
 * 
 *         if isinstance(value, unicode):
 *             value = value.encode('UTF-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string input_in_1 = <libcpp_string> value
 * 
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "pykeyvi.pyx":658
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0))
 *         cdef MatchIterator py_result = MatchIterator.__new__(MatchIterator)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "pykeyvi.pyx":669
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         cdef _MatchIteratorPair _r = self.inst.get().GetCompletions((<libcpp_string>in_0), (<int>in_1))
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "pykeyvi.pyx":696
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Compress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "pykeyvi.pyx":704
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst = shared_ptr[_PredictiveCompression](new _PredictiveCompression((<libcpp_string>in_0)))
 * 
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "pykeyvi.pyx":710
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef libcpp_string _r = self.inst.get().Uncompress((<libcpp_string>in_0))
 *         py_result = <libcpp_string>_r
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "pykeyvi.pyx":729
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "pykeyvi.pyx":738
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().WriteToFile((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "pykeyvi.pyx":780
 *         assert isinstance(in_0, (bytes, unicode)), 'arg in_0 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().Add((<libcpp_string>in_0))
 * 
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "pykeyvi.pyx":837
 *         assert isinstance(matched_string, (bytes, unicode)), 'arg matched_string wrong type'
 *         if isinstance(matched_string, unicode):
 *             matched_string = matched_string.encode('utf-8')             # <<<<<<<<<<<<<<
 *         self.inst.get().SetMatchedString((<libcpp_string>matched_string))
 * 
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "pykeyvi.pyx":903
 *     def GetAttribute(self, key):
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")             # <<<<<<<<<<<<<<
 * 
 *         py_result = self.inst.get().GetAttributePy(<libcpp_string> key)
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pykeyvi.pyx":911
 *     def SetAttribute(self, key, value):
 *         if isinstance(key, unicode):
 *             key = key.encode("utf-8")             # <<<<<<<<<<<<<<
 * 
 *         t = type(value)
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "pykeyvi.pyx":917
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value)
 *         elif t == unicode:
 *             value_utf8 = value.encode("utf-8")             # <<<<<<<<<<<<<<
 *             self.inst.get().SetAttribute(<libcpp_string> key, <libcpp_string> value_utf8)
 *         elif t == float:
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pykeyvi.pyx":927
 *             self.inst.get().SetAttribute(<libcpp_string> key, <bool> value)
 *         else:
 *             raise Exception("Unsupported Value Type")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_Value_Type); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "pykeyvi.pyx":997
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().__setitem__((<libcpp_string>in_0), (<int>in_1))
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "pykeyvi.pyx":1005
 *         assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 *         if isinstance(in_0, unicode):
 *             in_0 = in_0.encode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         self.inst.get().Add((<libcpp_string>in_0), (<int>in_1))
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "pykeyvi.pyx":38
 *     char * _cast_const_away(char *)
 * 
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */
  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_in_0, __pyx_n_s_in_1, __pyx_n_s_input_in_0, __pyx_n_s_r, __pyx_n_s_py_result); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_narek_projects_keyvi_pyke, __pyx_n_s_JumpConsistentHashString, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pykeyvi.pyx":968
 * 
 *     @staticmethod
 *     def loads(serialized_match):             # <<<<<<<<<<<<<<
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 */
  __pyx_tuple__51 = PyTuple_Pack(4, __pyx_n_s_serialized_match, __pyx_n_s_m, __pyx_n_s_unserialized, __pyx_n_s_number_of_fields); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_narek_projects_keyvi_pyke, __pyx_n_s_loads, 968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initpykeyvi(void); /*proto*/
PyMODINIT_FUNC initpykeyvi(void)
#else
PyMODINIT_FUNC PyInit_pykeyvi(void); /*proto*/
PyMODINIT_FUNC PyInit_pykeyvi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pykeyvi(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("pykeyvi", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_pykeyvi) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pykeyvi")) {
      if (unlikely(PyDict_SetItemString(modules, "pykeyvi", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_7pykeyvi_JsonDictionaryMerger) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_JsonDictionaryMerger.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "JsonDictionaryMerger", (PyObject *)&__pyx_type_7pykeyvi_JsonDictionaryMerger) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_JsonDictionaryMerger = &__pyx_type_7pykeyvi_JsonDictionaryMerger;
  if (PyType_Ready(&__pyx_type_7pykeyvi_StringDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_StringDictionaryCompiler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "StringDictionaryCompiler", (PyObject *)&__pyx_type_7pykeyvi_StringDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_StringDictionaryCompiler = &__pyx_type_7pykeyvi_StringDictionaryCompiler;
  if (PyType_Ready(&__pyx_type_7pykeyvi_JsonDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_JsonDictionaryCompiler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "JsonDictionaryCompiler", (PyObject *)&__pyx_type_7pykeyvi_JsonDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_JsonDictionaryCompiler = &__pyx_type_7pykeyvi_JsonDictionaryCompiler;
  if (PyType_Ready(&__pyx_type_7pykeyvi_Dictionary) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_Dictionary.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "Dictionary", (PyObject *)&__pyx_type_7pykeyvi_Dictionary) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_Dictionary = &__pyx_type_7pykeyvi_Dictionary;
  if (PyType_Ready(&__pyx_type_7pykeyvi_FsaTransform) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_FsaTransform.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "FsaTransform", (PyObject *)&__pyx_type_7pykeyvi_FsaTransform) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_FsaTransform = &__pyx_type_7pykeyvi_FsaTransform;
  if (PyType_Ready(&__pyx_type_7pykeyvi_PrefixCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_PrefixCompletion.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "PrefixCompletion", (PyObject *)&__pyx_type_7pykeyvi_PrefixCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_PrefixCompletion = &__pyx_type_7pykeyvi_PrefixCompletion;
  if (PyType_Ready(&__pyx_type_7pykeyvi_ForwardBackwardCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_ForwardBackwardCompletion.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ForwardBackwardCompletion", (PyObject *)&__pyx_type_7pykeyvi_ForwardBackwardCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_ForwardBackwardCompletion = &__pyx_type_7pykeyvi_ForwardBackwardCompletion;
  if (PyType_Ready(&__pyx_type_7pykeyvi_loading_strategy_types) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_loading_strategy_types.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "loading_strategy_types", (PyObject *)&__pyx_type_7pykeyvi_loading_strategy_types) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_loading_strategy_types = &__pyx_type_7pykeyvi_loading_strategy_types;
  if (PyType_Ready(&__pyx_type_7pykeyvi_JsonDictionaryCompilerSmallData) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_JsonDictionaryCompilerSmallData.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "JsonDictionaryCompilerSmallData", (PyObject *)&__pyx_type_7pykeyvi_JsonDictionaryCompilerSmallData) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_JsonDictionaryCompilerSmallData = &__pyx_type_7pykeyvi_JsonDictionaryCompilerSmallData;
  if (PyType_Ready(&__pyx_type_7pykeyvi_MultiWordCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_MultiWordCompletion.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "MultiWordCompletion", (PyObject *)&__pyx_type_7pykeyvi_MultiWordCompletion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_MultiWordCompletion = &__pyx_type_7pykeyvi_MultiWordCompletion;
  if (PyType_Ready(&__pyx_type_7pykeyvi_PredictiveCompression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_PredictiveCompression.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "PredictiveCompression", (PyObject *)&__pyx_type_7pykeyvi_PredictiveCompression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_PredictiveCompression = &__pyx_type_7pykeyvi_PredictiveCompression;
  if (PyType_Ready(&__pyx_type_7pykeyvi_KeyOnlyDictionaryGenerator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_KeyOnlyDictionaryGenerator.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "KeyOnlyDictionaryGenerator", (PyObject *)&__pyx_type_7pykeyvi_KeyOnlyDictionaryGenerator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_KeyOnlyDictionaryGenerator = &__pyx_type_7pykeyvi_KeyOnlyDictionaryGenerator;
  if (PyType_Ready(&__pyx_type_7pykeyvi_KeyOnlyDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_KeyOnlyDictionaryCompiler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "KeyOnlyDictionaryCompiler", (PyObject *)&__pyx_type_7pykeyvi_KeyOnlyDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_KeyOnlyDictionaryCompiler = &__pyx_type_7pykeyvi_KeyOnlyDictionaryCompiler;
  if (PyType_Ready(&__pyx_type_7pykeyvi_Match) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_Match.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "Match", (PyObject *)&__pyx_type_7pykeyvi_Match) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_Match = &__pyx_type_7pykeyvi_Match;
  if (PyType_Ready(&__pyx_type_7pykeyvi_CompletionDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_CompletionDictionaryCompiler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "CompletionDictionaryCompiler", (PyObject *)&__pyx_type_7pykeyvi_CompletionDictionaryCompiler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_CompletionDictionaryCompiler = &__pyx_type_7pykeyvi_CompletionDictionaryCompiler;
  if (PyType_Ready(&__pyx_type_7pykeyvi_MatchIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi_MatchIterator.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "MatchIterator", (PyObject *)&__pyx_type_7pykeyvi_MatchIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7pykeyvi_MatchIterator = &__pyx_type_7pykeyvi_MatchIterator;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct___init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct___init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct___init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct___init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_1_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_1_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_2_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_2_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_2_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_3___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_3___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_3___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_3___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_4_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_4_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_4_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_4_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_5_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_5_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_6__init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_6__init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_6__init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct_6__init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_7_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_7_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_7_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_7_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_8_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_8_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_9___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_9___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_9___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_9___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_10_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_10_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_10_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_11_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_11_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_11_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_11_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_12__init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_12__init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_12__init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct_12__init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_13_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_13_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_13_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_13_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_14_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_14_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_14_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_15___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_15___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_15___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_15___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_16_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_16_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_16_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_16_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_17_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_17_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_17_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper = &__pyx_type_7pykeyvi___pyx_scope_struct_18__key_iterator_wrapper;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper = &__pyx_type_7pykeyvi___pyx_scope_struct_19__value_iterator_wrapper;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper = &__pyx_type_7pykeyvi___pyx_scope_struct_20__item_iterator_wrapper;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_21__init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_21__init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_21__init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct_21__init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_22_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_22_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_22_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_22_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_23_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_23_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_23_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_24___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_24___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_24___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_24___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_25_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_25_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_25_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_26_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_26_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_26_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_26_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_27__init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_27__init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_27__init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct_27__init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_28_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_28_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_28_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_28_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_29_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_29_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_29_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_30___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_30___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_30___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_30___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_31_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_31_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_31_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_31_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_32_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_32_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_32_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_32_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_33__init_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_33__init_2.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_33__init_2 = &__pyx_type_7pykeyvi___pyx_scope_struct_33__init_2;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_34_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_34_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_34_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_34_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_35_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_35_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_35_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_35_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_36___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_36___init__.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_36___init__ = &__pyx_type_7pykeyvi___pyx_scope_struct_36___init__;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_37_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_37_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_37_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_37_genexpr;
  if (PyType_Ready(&__pyx_type_7pykeyvi___pyx_scope_struct_38_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7pykeyvi___pyx_scope_struct_38_genexpr.tp_print = 0;
  __pyx_ptype_7pykeyvi___pyx_scope_struct_38_genexpr = &__pyx_type_7pykeyvi___pyx_scope_struct_38_genexpr;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pykeyvi.pyx":38
 *     char * _cast_const_away(char *)
 * 
 * def JumpConsistentHashString(bytes in_0 ,  in_1 ):             # <<<<<<<<<<<<<<
 *     assert isinstance(in_0, bytes), 'arg in_0 wrong type'
 *     assert isinstance(in_1, (int, long)), 'arg in_1 wrong type'
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pykeyvi_1JumpConsistentHashString, NULL, __pyx_n_s_pykeyvi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JumpConsistentHashString, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":547
 * 
 * cdef class loading_strategy_types:
 *     default_os = 0             # <<<<<<<<<<<<<<
 *     lazy = 1
 *     populate = 2
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_default_os, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":548
 * cdef class loading_strategy_types:
 *     default_os = 0
 *     lazy = 1             # <<<<<<<<<<<<<<
 *     populate = 2
 *     populate_key_part = 3
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_lazy, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":549
 *     default_os = 0
 *     lazy = 1
 *     populate = 2             # <<<<<<<<<<<<<<
 *     populate_key_part = 3
 *     populate_lazy = 4
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_populate, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":550
 *     lazy = 1
 *     populate = 2
 *     populate_key_part = 3             # <<<<<<<<<<<<<<
 *     populate_lazy = 4
 *     lazy_no_readahead = 5
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_populate_key_part, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":551
 *     populate = 2
 *     populate_key_part = 3
 *     populate_lazy = 4             # <<<<<<<<<<<<<<
 *     lazy_no_readahead = 5
 *     lazy_no_readahead_value_part = 6
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_populate_lazy, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":552
 *     populate_key_part = 3
 *     populate_lazy = 4
 *     lazy_no_readahead = 5             # <<<<<<<<<<<<<<
 *     lazy_no_readahead_value_part = 6
 *     populate_key_part_no_readahead_value_part = 7
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_lazy_no_readahead, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":553
 *     populate_lazy = 4
 *     lazy_no_readahead = 5
 *     lazy_no_readahead_value_part = 6             # <<<<<<<<<<<<<<
 *     populate_key_part_no_readahead_value_part = 7
 * 
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_lazy_no_readahead_value_part, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":554
 *     lazy_no_readahead = 5
 *     lazy_no_readahead_value_part = 6
 *     populate_key_part_no_readahead_value_part = 7             # <<<<<<<<<<<<<<
 * 
 * cdef class JsonDictionaryCompilerSmallData:
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_loading_strategy_types->tp_dict, __pyx_n_s_populate_key_part_no_readahead_v, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_7pykeyvi_loading_strategy_types);

  /* "pykeyvi.pyx":968
 * 
 *     @staticmethod
 *     def loads(serialized_match):             # <<<<<<<<<<<<<<
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pykeyvi_5Match_45loads, NULL, __pyx_n_s_pykeyvi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pykeyvi.pyx":967
 *          self.inst.get().SetRawValue(<libcpp_string> str)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def loads(serialized_match):
 *         m=Match()
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_Match->tp_dict, __pyx_n_s_loads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7pykeyvi_Match);

  /* "pykeyvi.pyx":968
 * 
 *     @staticmethod
 *     def loads(serialized_match):             # <<<<<<<<<<<<<<
 *         m=Match()
 *         unserialized = msgpack.loads(serialized_match)
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_7pykeyvi_Match, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pykeyvi.pyx":967
 *          self.inst.get().SetRawValue(<libcpp_string> str)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def loads(serialized_match):
 *         m=Match()
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pykeyvi_Match->tp_dict, __pyx_n_s_loads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7pykeyvi_Match);

  /* "pykeyvi.pyx":1076
 * from libc.stdint cimport uint32_t
 * 
 * import json             # <<<<<<<<<<<<<<
 * import msgpack
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":1077
 * 
 * import json
 * import msgpack             # <<<<<<<<<<<<<<
 * 
 * # same import style as autowrap
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_msgpack, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_msgpack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pykeyvi.pyx":1
 * #cython: c_string_encoding=ascii  # for cython>=0.19             # <<<<<<<<<<<<<<
 * from  libcpp.string  cimport string as libcpp_string
 * from  libcpp.string  cimport string as libcpp_utf8_string
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "string.to_py":30
 * 
 * @cname("__pyx_convert_string_to_py_")
 * cdef object __pyx_convert_string_to_py_(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * 
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pykeyvi", __pyx_clineno, __pyx_lineno, __pyx_filename);
      Py_DECREF(__pyx_d); __pyx_d = 0;
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pykeyvi");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

#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

#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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_keys, d);
    else
        return PyDict_Keys(d);
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_values, d);
    else
        return PyDict_Values(d);
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_items, d);
    else
        return PyDict_Items(d);
}

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);
}

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");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

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;
}

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;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE 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;
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static 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;
}

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) {
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    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);
    Py_DECREF(res);
    return 0;
}
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}
};
#ifndef PY_WRITE_RESTRICTED
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
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]);
        PyMem_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 PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    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 (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd 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 (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_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);
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        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 (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
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;
}

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;
}

static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(uint32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, long, PyLong_AsLong(x))
            } else if (sizeof(uint32_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(uint32_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint32_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(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;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
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;
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyThreadState *tstate = PyThreadState_GET();
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Generator_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Generator_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Send(yf, value);
        } else {
            if (value == Py_None)
                ret = PyIter_Next(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, value);
}
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Generator_Close(yf);
        if (!retval)
            return -1;
    } else {
        PyObject *meth;
        gen->is_running = 1;
        meth = PyObject_GetAttr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Close(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Generator_CloseIter(gen, yf);
        __Pyx_Generator_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Generator_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Generator_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Generator_Undelegate(gen);
            if (err < 0)
                return __Pyx_Generator_SendEx(gen, NULL);
            goto throw_here;
        }
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Throw(yf, args);
        } else {
            PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Generator_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Generator_FinishDelegation(gen);
        }
        return ret;
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(gen, NULL);
}
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Generator_clear(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Generator_get_name(__pyx_GeneratorObject *self)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Generator_set_name(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Generator_get_qualname(__pyx_GeneratorObject *self)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Generator_set_qualname(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Generator_get_name, (setter)__Pyx_Generator_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Generator_get_qualname, (setter)__Pyx_Generator_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {"throw", (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {"close", (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_GeneratorObject),
    0,
    (destructor) __Pyx_Generator_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Generator_traverse,
    0,
    0,
    offsetof(__pyx_GeneratorObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Generator_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Generator_del,
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure, PyObject *name, PyObject *qualname) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (__pyx_GeneratorType == NULL) {
        return -1;
    }
    return 0;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_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 __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
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
