/* Generated by Cython 0.28.5 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "name": "metaphor.monal.util.toolbox",
        "sources": [
            "metaphor/monal/util/toolbox.py"
        ]
    },
    "module_name": "metaphor.monal.util.toolbox"
}
END: Cython Metadata */

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

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

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

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


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

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

#define __PYX_HAVE__metaphor__monal__util__toolbox
#define __PYX_HAVE_API__metaphor__monal__util__toolbox
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


static const char *__pyx_f[] = {
  "metaphor/monal/util/toolbox.py",
};

/*--- Type declarations ---*/
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr;
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults {
  PyObject *__pyx_arg_criterion;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_writer;
  PyObject *__pyx_arg_forbidden;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_config;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_Fct;
};

/* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key {
  PyObject_HEAD
  PyObject *__pyx_v_mycmp;
};


/* "metaphor/monal/util/toolbox.py":685
 *     return None, None
 * 
 * def rrange(start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *     if not step:
 *         step = 1.0
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange {
  PyObject_HEAD
  PyObject *__pyx_v_cur;
  PyObject *__pyx_v_start;
  PyObject *__pyx_v_step;
  PyObject *__pyx_v_stop;
};


/* "metaphor/monal/util/toolbox.py":880
 * #     return cmpstr(X, Y, getext)#lambda st: rpartition(st, '.')[2]
 * 
 * def getFilesByExt(directory, ext='', casesensitive=True):             # <<<<<<<<<<<<<<
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt {
  PyObject_HEAD
  PyObject *__pyx_v_casesensitive;
  PyObject *__pyx_v_df;
  PyObject *__pyx_v_directory;
  PyObject *__pyx_v_ext;
  PyObject *__pyx_v_f;
  PyObject *__pyx_v_lf;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread {
  PyObject_HEAD
  PyObject *__pyx_v_func;
  PyObject *__pyx_v_threading;
};


/* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx {
  PyObject_HEAD
  PyObject *__pyx_v_fillchar;
  PyObject *__pyx_v_iterator;
  PyObject *__pyx_v_limited;
  PyObject *__pyx_v_modifiedstr;
  PyObject *__pyx_v_sep;
};


/* "metaphor/monal/util/toolbox.py":1309
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides
 *         return sep.join(val for val in iterator if val)             # <<<<<<<<<<<<<<
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_outer_scope;
  PyObject *__pyx_v_val;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/monal/util/toolbox.py":1312
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)             # <<<<<<<<<<<<<<
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_outer_scope;
  PyObject *__pyx_v_val;
};


/* "metaphor/monal/util/toolbox.py":1314
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))             # <<<<<<<<<<<<<<
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_outer_scope;
  PyObject *__pyx_v_sepl;
  PyObject *__pyx_v_val;
};


/* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic {
  PyObject_HEAD
  PyObject *__pyx_v_dic;
};


/* "metaphor/monal/util/toolbox.py":1341
 *   - inter est plac entre la cl et la valeur
 * Les cls sont allonges alignes sur la plus longue."""
 *     ll = max(len(key) for key in list(dic.keys()))             # <<<<<<<<<<<<<<
 *     for key, value in list(dic.items()):
 *         if dico2 is None:
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *__pyx_outer_scope;
  PyObject *__pyx_v_key;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "metaphor/monal/util/toolbox.py":1359
 *     return value
 * 
 * def dataIterator(titles, *iterlist):             # <<<<<<<<<<<<<<
 *     yield list(titles)
 *     #ll = len(iterlist)
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator {
  PyObject_HEAD
  PyObject *__pyx_v_iterlist;
  PyObject *__pyx_v_titles;
  PyObject *__pyx_v_vallist;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/monal/util/toolbox.py":1370
 *     return 0
 * 
 * def reversed_enumerate(iterable):             # <<<<<<<<<<<<<<
 *     try:
 *         n = len(iterable)
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate {
  PyObject_HEAD
  PyObject *__pyx_v_iterable;
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_seq;
  PyObject *__pyx_v_val;
  Py_ssize_t __pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 {
  PyObject_HEAD
  PyObject *__pyx_v_instance;
};


/* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_props;
};


/* "metaphor/monal/util/toolbox.py":1455
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):             # <<<<<<<<<<<<<<
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_val;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory {
  PyObject_HEAD
  PyObject *__pyx_v_py_version;
};


/* "metaphor/monal/util/toolbox.py":1527
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *__pyx_outer_scope;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */
struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles {
  PyObject_HEAD
  PyObject *__pyx_v_ext;
};


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

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

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

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

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

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

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

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

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

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

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

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

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

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

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

/* py_dict_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);

/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

/* PyExec.proto */
static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

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

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

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

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

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

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

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

/* PyUnicode_Substring.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
            PyObject* text, Py_ssize_t start, Py_ssize_t stop);

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

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/* Module declarations from 'metaphor.monal.util.toolbox' */
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles = 0;
#define __Pyx_MODULE_NAME "metaphor.monal.util.toolbox"
extern int __pyx_module_is_main_metaphor__monal__util__toolbox;
int __pyx_module_is_main_metaphor__monal__util__toolbox = 0;

/* Implementation of 'metaphor.monal.util.toolbox' */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_SystemExit;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_hex;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_reversed;
static const char __pyx_k_0[] = "0";
static const char __pyx_k_1[] = "\\1";
static const char __pyx_k_2[] = "\\2";
static const char __pyx_k_3[] = "\\3";
static const char __pyx_k_4[] = "\\4";
static const char __pyx_k_5[] = "\\5";
static const char __pyx_k_6[] = "\\6";
static const char __pyx_k_7[] = "\\7";
static const char __pyx_k_8[] = "\\8";
static const char __pyx_k_9[] = "\\9";
static const char __pyx_k_A[] = "A";
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_K[] = "K";
static const char __pyx_k_L[] = "/L";
static const char __pyx_k_R[] = "_R";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "-c";
static const char __pyx_k_f[] = "\\f";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_l[] = "/l";
static const char __pyx_k_n[] = "\\n";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_v[] = "\\v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_0m[] = "\033[0m";
static const char __pyx_k_1m[] = "\033[1m";
static const char __pyx_k_4m[] = "\033[4m";
static const char __pyx_k_ID[] = "ID:      ";
static const char __pyx_k_OK[] = "OK";
static const char __pyx_k_cp[] = "cp";
static const char __pyx_k_df[] = "df";
static const char __pyx_k_eq[] = "__eq__";
static const char __pyx_k_ge[] = "__ge__";
static const char __pyx_k_gt[] = "__gt__";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_it[] = "__it__";
static const char __pyx_k_kw[] = "kw";
static const char __pyx_k_le[] = "__le__";
static const char __pyx_k_lf[] = "lf";
static const char __pyx_k_ll[] = "ll";
static const char __pyx_k_lt[] = "__lt__";
static const char __pyx_k_ne[] = "__ne__";
static const char __pyx_k_nl[] = "nl";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_st[] = "st";
static const char __pyx_k_tg[] = "tg";
static const char __pyx_k_tt[] = "tt";
static const char __pyx_k_ww[] = "ww";
static const char __pyx_k_0_2[] = "\\0";
static const char __pyx_k_91m[] = "\033[91m";
static const char __pyx_k_92m[] = "\033[92m";
static const char __pyx_k_93m[] = "\033[93m";
static const char __pyx_k_94m[] = "\033[94m";
static const char __pyx_k_95m[] = "\033[95m";
static const char __pyx_k_DOC[] = "DOC:     ";
static const char __pyx_k_Fct[] = "Fct";
static const char __pyx_k_H_M[] = "%H:%M";
static const char __pyx_k_NaN[] = "NaN";
static const char __pyx_k_PY3[] = "PY3";
static const char __pyx_k__17[] = "";
static const char __pyx_k__20[] = "\n";
static const char __pyx_k__24[] = "\\";
static const char __pyx_k__26[] = "\\\\";
static const char __pyx_k__32[] = "!";
static const char __pyx_k__35[] = ";";
static const char __pyx_k__46[] = ".";
static const char __pyx_k__56[] = "/";
static const char __pyx_k__58[] = " ";
static const char __pyx_k__66[] = "\t\t";
static const char __pyx_k__67[] = "\t";
static const char __pyx_k__70[] = "_";
static const char __pyx_k__85[] = "\007";
static const char __pyx_k__86[] = "\010";
static const char __pyx_k__87[] = "\014";
static const char __pyx_k__88[] = "\r";
static const char __pyx_k__89[] = "\013";
static const char __pyx_k__90[] = "'";
static const char __pyx_k__91[] = "\\'";
static const char __pyx_k__92[] = "\"";
static const char __pyx_k__93[] = "\\\"";
static const char __pyx_k__94[] = "\000";
static const char __pyx_k__95[] = "\001";
static const char __pyx_k__96[] = "\002";
static const char __pyx_k__97[] = "\003";
static const char __pyx_k__98[] = "\004";
static const char __pyx_k__99[] = "\005";
static const char __pyx_k_a_2[] = "\\a";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_b_2[] = "\\b";
static const char __pyx_k_c_2[] = "c";
static const char __pyx_k_c_3[] = "\\c";
static const char __pyx_k_chr[] = "chr";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_cur[] = "cur";
static const char __pyx_k_d_Z[] = "\\[\\d+\\]\\Z";
static const char __pyx_k_day[] = "day";
static const char __pyx_k_del[] = "_del_";
static const char __pyx_k_dic[] = "dic";
static const char __pyx_k_dim[] = "dim";
static const char __pyx_k_dir[] = "dir";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_err[] = "err";
static const char __pyx_k_ext[] = "ext";
static const char __pyx_k_f_2[] = "f";
static const char __pyx_k_fmt[] = "fmt";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_kwd[] = "kwd";
static const char __pyx_k_l_2[] = "l";
static const char __pyx_k_lim[] = "lim";
static const char __pyx_k_lst[] = "lst";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_mem[] = "mem";
static const char __pyx_k_n_2[] = "n";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_opt[] = "opt";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pth[] = "pth";
static const char __pyx_k_r_2[] = "\\r";
static const char __pyx_k_raw[] = "raw";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_sec[] = "sec";
static const char __pyx_k_sep[] = "sep";
static const char __pyx_k_seq[] = "seq";
static const char __pyx_k_set[] = "_set_";
static const char __pyx_k_six[] = "six";
static const char __pyx_k_sst[] = "sst";
static const char __pyx_k_st2[] = "st2";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_t_2[] = "\\t";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_BOLD[] = "BOLD";
static const char __pyx_k_ENDC[] = "ENDC";
static const char __pyx_k_FAIL[] = "FAIL";
static const char __pyx_k_Func[] = "Func";
static const char __pyx_k_IsOk[] = "IsOk";
static const char __pyx_k_NAME[] = "NAME:    ";
static const char __pyx_k_PIPE[] = "PIPE";
static const char __pyx_k_TYPE[] = "TYPE:    ";
static const char __pyx_k_True[] = "True";
static const char __pyx_k__100[] = "\006";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_argv[] = "argv";
static const char __pyx_k_aset[] = "aset";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_call[] = "__call__";
static const char __pyx_k_char[] = "char";
static const char __pyx_k_cond[] = "cond";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dico[] = "dico";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dirr[] = "dirr";
static const char __pyx_k_dirs[] = "dirs";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_fdel[] = "fdel";
static const char __pyx_k_fdoc[] = "fdoc";
static const char __pyx_k_fget[] = "fget";
static const char __pyx_k_file[] = "__file__";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_fset[] = "fset";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_it_2[] = "it";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kwds[] = "kwds";
static const char __pyx_k_line[] = "line";
static const char __pyx_k_lmin[] = "lmin";
static const char __pyx_k_lst2[] = "lst2";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mess[] = "mess";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_shft[] = "shft";
static const char __pyx_k_site[] = "site";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_targ[] = "targ";
static const char __pyx_k_temp[] = "temp";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_true[] = "true";
static const char __pyx_k_user[] = "--user";
static const char __pyx_k_walk[] = "walk";
static const char __pyx_k_CLASS[] = "CLASS:   ";
static const char __pyx_k_Popen[] = "Popen";
static const char __pyx_k_VALUE[] = "VALUE:   ";
static const char __pyx_k_bases[] = "bases";
static const char __pyx_k_black[] = "black";
static const char __pyx_k_blank[] = "blank";
static const char __pyx_k_byref[] = "byref";
static const char __pyx_k_cible[] = "cible";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_date0[] = "date0";
static const char __pyx_k_dico2[] = "dico2";
static const char __pyx_k_doc_2[] = "_doc_";
static const char __pyx_k_doc_3[] = "doc";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_files[] = "files";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_get_2[] = "_get_";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_inter[] = "inter";
static const char __pyx_k_intro[] = "intro";
static const char __pyx_k_isdir[] = "isdir";
static const char __pyx_k_isnum[] = "isnum";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_kwarg[] = "kwarg";
static const char __pyx_k_lines[] = "lines";
static const char __pyx_k_ljust[] = "ljust";
static const char __pyx_k_llist[] = "llist";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_month[] = "month";
static const char __pyx_k_mycmp[] = "mycmp";
static const char __pyx_k_mydir[] = "mydir";
static const char __pyx_k_nline[] = "nline";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_paths[] = "__paths__";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_props[] = "props";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rfind[] = "rfind";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_stlen[] = "stlen";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tilde[] = "tilde";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_wraps[] = "wraps";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_HEADER[] = "HEADER";
static const char __pyx_k_OKBLUE[] = "OKBLUE";
static const char __pyx_k_Thread[] = "Thread";
static const char __pyx_k_absmax[] = "absmax";
static const char __pyx_k_addstr[] = "addstr";
static const char __pyx_k_alevel[] = "alevel";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_aslice[] = "aslice";
static const char __pyx_k_before[] = "before";
static const char __pyx_k_c_char[] = "c_char";
static const char __pyx_k_chemin[] = "chemin";
static const char __pyx_k_colmem[] = "colmem";
static const char __pyx_k_config[] = "config";
static const char __pyx_k_ctypes[] = "ctypes";
static const char __pyx_k_del__s[] = "_del_%s";
static const char __pyx_k_direct[] = "direct";
static const char __pyx_k_dirloc[] = "dirloc";
static const char __pyx_k_doc__s[] = "_doc_%s";
static const char __pyx_k_epochs[] = "epochs";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_get__s[] = "_get_%s";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_index1[] = "index1";
static const char __pyx_k_index2[] = "index2";
static const char __pyx_k_init_2[] = "init";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_isfile[] = "isfile";
static const char __pyx_k_joinEx[] = "joinEx";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_linker[] = "linker";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_myfile[] = "myfile";
static const char __pyx_k_mytest[] = "mytest";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_pprint[] = "pprint";
static const char __pyx_k_prefix[] = "prefix";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rmtree[] = "rmtree";
static const char __pyx_k_rrange[] = "rrange";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_set__s[] = "_set_%s";
static const char __pyx_k_shutil[] = "shutil";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_suffix[] = "suffix";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_test_2[] = "__test__";
static const char __pyx_k_titles[] = "titles";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_vector[] = "vector";
static const char __pyx_k_writer[] = "writer";
static const char __pyx_k_OKGREEN[] = "OKGREEN";
static const char __pyx_k_OSError[] = "OSError";
static const char __pyx_k_RegFile[] = "RegFile";
static const char __pyx_k_WARNING[] = "WARNING";
static const char __pyx_k_abspath[] = "abspath";
static const char __pyx_k_aleastr[] = "aleastr";
static const char __pyx_k_alllist[] = "alllist";
static const char __pyx_k_bcolors[] = "bcolors";
static const char __pyx_k_boolstr[] = "boolstr";
static const char __pyx_k_cValues[] = "cValues";
static const char __pyx_k_datelst[] = "datelst";
static const char __pyx_k_datestr[] = "datestr";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_defconf[] = "defconf";
static const char __pyx_k_dirname[] = "dirname";
static const char __pyx_k_doprint[] = "doprint";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_findall[] = "findall";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_homedir[] = "homedir";
static const char __pyx_k_index_2[] = "_index";
static const char __pyx_k_isfield[] = "isfield";
static const char __pyx_k_limited[] = "limited";
static const char __pyx_k_linkstr[] = "_linkstr";
static const char __pyx_k_listdir[] = "listdir";
static const char __pyx_k_modname[] = "modname";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_package[] = "package";
static const char __pyx_k_paths_2[] = "paths";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_print_2[] = "print_";
static const char __pyx_k_printnl[] = "printnl";
static const char __pyx_k_product[] = "product";
static const char __pyx_k_randint[] = "randint";
static const char __pyx_k_regFile[] = "regFile";
static const char __pyx_k_section[] = "section";
static const char __pyx_k_setlen2[] = "setlen2";
static const char __pyx_k_tempDir[] = "tempDir";
static const char __pyx_k_timestr[] = "timestr";
static const char __pyx_k_unquote[] = "unquote";
static const char __pyx_k_vallist[] = "vallist";
static const char __pyx_k_wrapper[] = "wrapper";
static const char __pyx_k_Callable[] = "Callable";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_add2path[] = "add2path";
static const char __pyx_k_appendex[] = "appendex";
static const char __pyx_k_autoprop[] = "autoprop";
static const char __pyx_k_builtins[] = "__builtins__";
static const char __pyx_k_c_double[] = "c_double";
static const char __pyx_k_cleanDir[] = "cleanDir";
static const char __pyx_k_datelong[] = "datelong";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_dir_path[] = "dir_path";
static const char __pyx_k_dothread[] = "dothread";
static const char __pyx_k_endswith[] = "endswith";
static const char __pyx_k_filelist[] = "filelist";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_fillchar[] = "fillchar";
static const char __pyx_k_instance[] = "instance";
static const char __pyx_k_iterable[] = "iterable";
static const char __pyx_k_iterator[] = "iterator";
static const char __pyx_k_iterlist[] = "iterlist";
static const char __pyx_k_levelmax[] = "levelmax";
static const char __pyx_k_make_dir[] = "make_dir";
static const char __pyx_k_makedirs[] = "makedirs";
static const char __pyx_k_module_2[] = "module";
static const char __pyx_k_normcase[] = "normcase";
static const char __pyx_k_normpath[] = "normpath";
static const char __pyx_k_nperline[] = "nperline";
static const char __pyx_k_optional[] = "optional";
static const char __pyx_k_pathlist[] = "pathlist";
static const char __pyx_k_printdoc[] = "printdoc";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rangestr[] = "rangestr";
static const char __pyx_k_reversed[] = "reversed";
static const char __pyx_k_sections[] = "sections";
static const char __pyx_k_splitext[] = "splitext";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_strtolen[] = "strtolen";
static const char __pyx_k_tempfile[] = "tempfile";
static const char __pyx_k_textAttr[] = "textAttr";
static const char __pyx_k_training[] = "training";
static const char __pyx_k_CheckFile[] = "CheckFile";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_UNDERLINE[] = "UNDERLINE";
static const char __pyx_k_WriteText[] = "WriteText";
static const char __pyx_k_candidate[] = "candidate";
static const char __pyx_k_checkFile[] = "checkFile";
static const char __pyx_k_criterion[] = "criterion";
static const char __pyx_k_directory[] = "directory";
static const char __pyx_k_direxists[] = "direxists";
static const char __pyx_k_dupescape[] = "dupescape";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_filename2[] = "filename2";
static const char __pyx_k_firstline[] = "firstline";
static const char __pyx_k_forbidden[] = "forbidden";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_initCount[] = "initCount";
static const char __pyx_k_listorint[] = "listorint";
static const char __pyx_k_listorstr[] = "listorstr";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_readlines[] = "readlines";
static const char __pyx_k_recursive[] = "recursive";
static const char __pyx_k_resultdir[] = "resultdir";
static const char __pyx_k_save_argv[] = "save_argv";
static const char __pyx_k_shiftText[] = "shiftText";
static const char __pyx_k_singleton[] = "singleton";
static const char __pyx_k_strCommon[] = "strCommon";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_LoadConfig[] = "LoadConfig";
static const char __pyx_k_NDKdllName[] = "NDKdllName";
static const char __pyx_k_PYTHONPATH[] = "PYTHONPATH";
static const char __pyx_k_SystemExit[] = "SystemExit";
static const char __pyx_k_TCR_NOSORT[] = "TCR_NOSORT";
static const char __pyx_k_TextColour[] = "TextColour";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WriteImage[] = "WriteImage";
static const char __pyx_k_checkIndex[] = "checkIndex";
static const char __pyx_k_cleanfiles[] = "cleanfiles";
static const char __pyx_k_cmp_to_key[] = "cmp_to_key";
static const char __pyx_k_configfile[] = "configfile";
static const char __pyx_k_creating_s[] = "creating %s\n";
static const char __pyx_k_expanduser[] = "expanduser";
static const char __pyx_k_fileexists[] = "fileexists";
static const char __pyx_k_filesource[] = "filesource";
static const char __pyx_k_getCVector[] = "getCVector";
static const char __pyx_k_getOptions[] = "getOptions";
static const char __pyx_k_gettempdir[] = "gettempdir";
static const char __pyx_k_initstddev[] = "initstddev";
static const char __pyx_k_isiterable[] = "isiterable";
static const char __pyx_k_lookInTree[] = "lookInTree";
static const char __pyx_k_monalconst[] = "monalconst";
static const char __pyx_k_py_version[] = "py_version";
static const char __pyx_k_run_script[] = "run_script";
static const char __pyx_k_singleton2[] = "singleton2";
static const char __pyx_k_splitfield[] = "splitfield";
static const char __pyx_k_splitlines[] = "splitlines";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_textwriter[] = "textwriter";
static const char __pyx_k_writeImage[] = "writeImage";
static const char __pyx_k_CALLABLE_no[] = "CALLABLE: no";
static const char __pyx_k_ContainsAny[] = "ContainsAny";
static const char __pyx_k_DEFAULTSECT[] = "DEFAULTSECT";
static const char __pyx_k_GetAsString[] = "GetAsString";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_IsValidHour[] = "IsValidHour";
static const char __pyx_k_TrueToEmpty[] = "TrueToEmpty";
static const char __pyx_k_add_section[] = "add_section";
static const char __pyx_k_addpathlist[] = "addpathlist";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_communicate[] = "communicate";
static const char __pyx_k_escape_dict[] = "escape_dict";
static const char __pyx_k_exec_prefix[] = "exec_prefix";
static const char __pyx_k_getfiletype[] = "getfiletype";
static const char __pyx_k_getindexstr[] = "getindexstr";
static const char __pyx_k_has_section[] = "has_section";
static const char __pyx_k_hexstrtoint[] = "hexstrtoint";
static const char __pyx_k_interrogate[] = "interrogate";
static const char __pyx_k_inttohexstr[] = "inttohexstr";
static const char __pyx_k_lookForFile[] = "lookForFile";
static const char __pyx_k_maxexcluded[] = "maxexcluded";
static const char __pyx_k_minincluded[] = "minincluded";
static const char __pyx_k_modifiedstr[] = "modifiedstr";
static const char __pyx_k_packagename[] = "packagename";
static const char __pyx_k_script_args[] = "script_args";
static const char __pyx_k_script_name[] = "script_name";
static const char __pyx_k_slicexrange[] = "slicexrange";
static const char __pyx_k_CALLABLE_Yes[] = "CALLABLE: Yes";
static const char __pyx_k_ConfigParser[] = "ConfigParser";
static const char __pyx_k_FalseToEmpty[] = "FalseToEmpty";
static const char __pyx_k_FullFileName[] = "FullFileName";
static const char __pyx_k_MonaEx70_dll[] = "MonaEx70.dll";
static const char __pyx_k_ShowPosition[] = "ShowPosition";
static const char __pyx_k_analyserange[] = "analyserange";
static const char __pyx_k_configparser[] = "configparser";
static const char __pyx_k_dataIterator[] = "dataIterator";
static const char __pyx_k_estimatedstr[] = "estimatedstr";
static const char __pyx_k_fullFileName[] = "fullFileName";
static const char __pyx_k_get2indexstr[] = "get2indexstr";
static const char __pyx_k_getexecparam[] = "getexecparam";
static const char __pyx_k_global_cache[] = "global_cache";
static const char __pyx_k_hasBoolValue[] = "hasBoolValue";
static const char __pyx_k_locationpath[] = "locationpath";
static const char __pyx_k_new_original[] = "__new_original__";
static const char __pyx_k_nonZeroToOne[] = "nonZeroToOne";
static const char __pyx_k_propertyname[] = "propertyname";
static const char __pyx_k_selectedData[] = "selectedData";
static const char __pyx_k_tempFileName[] = "tempFileName";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_worksheetstr[] = "worksheetstr";
static const char __pyx_k_SetTextColour[] = "SetTextColour";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_addPythonPath[] = "addPythonPath";
static const char __pyx_k_addToFileName[] = "addToFileName";
static const char __pyx_k_adduniqueline[] = "adduniqueline";
static const char __pyx_k_caseSensitive[] = "caseSensitive";
static const char __pyx_k_casesensitive[] = "casesensitive";
static const char __pyx_k_getFilesByExt[] = "getFilesByExt";
static const char __pyx_k_getPythonPath[] = "getPythonPath";
static const char __pyx_k_getconfigfile[] = "getconfigfile";
static const char __pyx_k_init_original[] = "__init_original__";
static const char __pyx_k_singleton_new[] = "singleton_new";
static const char __pyx_k_updatesection[] = "updatesection";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_InsertionPoint[] = "InsertionPoint";
static const char __pyx_k_NoSectionError[] = "NoSectionError";
static const char __pyx_k_PrettyPrintDic[] = "PrettyPrintDic";
static const char __pyx_k_cached_listdir[] = "cached_listdir";
static const char __pyx_k_initialization[] = "initialization";
static const char __pyx_k_removelinewith[] = "removelinewith";
static const char __pyx_k_A_A_Za_z__1_w_Z[] = "\\A[A-Za-z_]{1}[-\\w]*\\Z";
static const char __pyx_k_Dimension_error[] = "Dimension error";
static const char __pyx_k_GetDefaultStyle[] = "GetDefaultStyle";
static const char __pyx_k_IndexValueError[] = "IndexValueError";
static const char __pyx_k_Monaex70__d_dll[] = "Monaex70_%d.dll";
static const char __pyx_k_RawConfigParser[] = "RawConfigParser";
static const char __pyx_k_SetDefaultStyle[] = "SetDefaultStyle";
static const char __pyx_k_autoprop___init[] = "autoprop.__init__";
static const char __pyx_k_createAleaTable[] = "createAleaTable";
static const char __pyx_k_idemDefaultDict[] = "idemDefaultDict";
static const char __pyx_k_nntoolbox_utils[] = "nntoolbox.utils";
static const char __pyx_k_resultdirectory[] = "resultdirectory";
static const char __pyx_k_testresidualstr[] = "testresidualstr";
static const char __pyx_k_SafeConfigParser[] = "SafeConfigParser";
static const char __pyx_k_getIndexInVector[] = "getIndexInVector";
static const char __pyx_k_namefromfilename[] = "namefromfilename";
static const char __pyx_k_textwriter_flush[] = "textwriter.flush";
static const char __pyx_k_textwriter_write[] = "textwriter.write";
static const char __pyx_k_textwriter___init[] = "textwriter.__init__";
static const char __pyx_k_binaries_directory[] = "binaries_directory";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_reversed_enumerate[] = "reversed_enumerate";
static const char __pyx_k_cmp_to_key_locals_K[] = "cmp_to_key.<locals>.K";
static const char __pyx_k_getusersitepackages[] = "getusersitepackages";
static const char __pyx_k_deletefilebyFonction[] = "deletefilebyFonction";
static const char __pyx_k_defaultedConfigParser[] = "defaultedConfigParser";
static const char __pyx_k_joinEx_locals_genexpr[] = "joinEx.<locals>.genexpr";
static const char __pyx_k_textwriter_writeImage[] = "textwriter.writeImage";
static const char __pyx_k_IndexValueError___init[] = "IndexValueError.__init__";
static const char __pyx_k_IndexValueError_lambda[] = "IndexValueError.<lambda>";
static const char __pyx_k_file_s_does_not_exists[] = "file %s does not exists";
static const char __pyx_k_idemDefaultDict___init[] = "idemDefaultDict.__init__";
static const char __pyx_k_datelong_locals_setlen2[] = "datelong.<locals>.setlen2";
static const char __pyx_k_dothread_locals_wrapper[] = "dothread.<locals>.wrapper";
static const char __pyx_k_setTrainingActionParams[] = "setTrainingActionParams";
static const char __pyx_k_cleanfiles_locals_lambda[] = "cleanfiles.<locals>.<lambda>";
static const char __pyx_k_cmp_to_key_locals_K___eq[] = "cmp_to_key.<locals>.K.__eq__";
static const char __pyx_k_cmp_to_key_locals_K___ge[] = "cmp_to_key.<locals>.K.__ge__";
static const char __pyx_k_cmp_to_key_locals_K___gt[] = "cmp_to_key.<locals>.K.__gt__";
static const char __pyx_k_cmp_to_key_locals_K___le[] = "cmp_to_key.<locals>.K.__le__";
static const char __pyx_k_cmp_to_key_locals_K___lt[] = "cmp_to_key.<locals>.K.__lt__";
static const char __pyx_k_cmp_to_key_locals_K___ne[] = "cmp_to_key.<locals>.K.__ne__";
static const char __pyx_k_singleton2_locals_lambda[] = "singleton2.<locals>.<lambda>";
static const char __pyx_k_Error_in_calling_script_s[] = "Error in calling script \"%s\"";
static const char __pyx_k_idemDefaultDict___getitem[] = "idemDefaultDict.__getitem__";
static const char __pyx_k_joinEx_locals_modifiedstr[] = "joinEx.<locals>.modifiedstr";
static const char __pyx_k_cmp_to_key_locals_K___init[] = "cmp_to_key.<locals>.K.__init__";
static const char __pyx_k_lib_python_s_dist_packages[] = "/lib/python%s/dist-packages/";
static const char __pyx_k_lib_python_s_site_packages[] = "/lib/python%s/site-packages/";
static const char __pyx_k_metaphor_monal_util_toolbox[] = "metaphor.monal.util.toolbox";
static const char __pyx_k_PrettyPrintDic_locals_genexpr[] = "PrettyPrintDic.<locals>.genexpr";
static const char __pyx_k_nntoolbox_configparsertoolbox[] = "nntoolbox.configparsertoolbox";
static const char __pyx_k_Library_Python_s_site_packages[] = "/Library/Python/%s/site-packages/";
static const char __pyx_k_metaphor_monal_util_toolbox_py[] = "metaphor/monal/util/toolbox.py";
static const char __pyx_k_singleton_locals_singleton_new[] = "singleton.<locals>.singleton_new";
static const char __pyx_k_Dictionnaire_dont_la_valeur_par[] = "Dictionnaire dont la valeur par d\303\203\302\251faut est la valeur de la cl\303\203\302\251 present\303\203\302\251e.\n    ";
static const char __pyx_k_autoprop_metaclasse_definissant[] = "autoprop : metaclasse definissant automatiquement les proprietes.\n    \nPendant l'initialisation, enregistre tous les attributs de nom _get_xxx, \n_set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes \nde nom xxx avec les fonctions d'acces correspondantes.";
static const char __pyx_k_local_lib_python_s_dist_package[] = "/local/lib/python%s/dist-packages/";
static const char __pyx_k_local_lib_python_s_site_package[] = "/local/lib/python%s/site-packages/";
static const char __pyx_k_autoprop___init___locals_genexpr[] = "autoprop.__init__.<locals>.genexpr";
static const char __pyx_k_binaries_directory_locals_genexp[] = "binaries_directory.<locals>.genexpr";
static const char __pyx_k_deletefilebyFonction_locals_lamb[] = "deletefilebyFonction.<locals>.<lambda>";
static PyObject *__pyx_kp_u_0;
static PyObject *__pyx_kp_u_0_2;
static PyObject *__pyx_kp_u_0m;
static PyObject *__pyx_kp_u_1;
static PyObject *__pyx_kp_u_1m;
static PyObject *__pyx_kp_u_2;
static PyObject *__pyx_kp_u_3;
static PyObject *__pyx_kp_u_4;
static PyObject *__pyx_kp_u_4m;
static PyObject *__pyx_kp_u_5;
static PyObject *__pyx_kp_u_6;
static PyObject *__pyx_kp_u_7;
static PyObject *__pyx_kp_u_8;
static PyObject *__pyx_kp_u_9;
static PyObject *__pyx_kp_u_91m;
static PyObject *__pyx_kp_u_92m;
static PyObject *__pyx_kp_u_93m;
static PyObject *__pyx_kp_u_94m;
static PyObject *__pyx_kp_u_95m;
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_kp_u_A_A_Za_z__1_w_Z;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_n_s_BOLD;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_kp_u_CALLABLE_Yes;
static PyObject *__pyx_kp_u_CALLABLE_no;
static PyObject *__pyx_kp_u_CLASS;
static PyObject *__pyx_n_s_Callable;
static PyObject *__pyx_n_s_CheckFile;
static PyObject *__pyx_n_s_ConfigParser;
static PyObject *__pyx_n_s_ContainsAny;
static PyObject *__pyx_n_s_DEFAULTSECT;
static PyObject *__pyx_kp_u_DOC;
static PyObject *__pyx_kp_s_Dictionnaire_dont_la_valeur_par;
static PyObject *__pyx_kp_u_Dimension_error;
static PyObject *__pyx_n_s_ENDC;
static PyObject *__pyx_kp_u_Error_in_calling_script_s;
static PyObject *__pyx_n_s_FAIL;
static PyObject *__pyx_n_s_FalseToEmpty;
static PyObject *__pyx_n_s_Fct;
static PyObject *__pyx_n_s_FullFileName;
static PyObject *__pyx_n_s_Func;
static PyObject *__pyx_n_s_GetAsString;
static PyObject *__pyx_n_s_GetDefaultStyle;
static PyObject *__pyx_n_s_HEADER;
static PyObject *__pyx_kp_u_H_M;
static PyObject *__pyx_kp_u_ID;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_IndexValueError;
static PyObject *__pyx_n_s_IndexValueError___init;
static PyObject *__pyx_n_s_IndexValueError_lambda;
static PyObject *__pyx_n_s_InsertionPoint;
static PyObject *__pyx_n_s_IsOk;
static PyObject *__pyx_n_s_IsValidHour;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_u_L;
static PyObject *__pyx_kp_u_Library_Python_s_site_packages;
static PyObject *__pyx_n_s_LoadConfig;
static PyObject *__pyx_kp_u_MonaEx70_dll;
static PyObject *__pyx_kp_u_Monaex70__d_dll;
static PyObject *__pyx_kp_u_NAME;
static PyObject *__pyx_n_s_NDKdllName;
static PyObject *__pyx_n_s_NaN;
static PyObject *__pyx_n_s_NoSectionError;
static PyObject *__pyx_n_s_OK;
static PyObject *__pyx_n_s_OKBLUE;
static PyObject *__pyx_n_s_OKGREEN;
static PyObject *__pyx_n_s_OSError;
static PyObject *__pyx_n_s_PIPE;
static PyObject *__pyx_n_s_PY3;
static PyObject *__pyx_n_u_PYTHONPATH;
static PyObject *__pyx_n_s_Popen;
static PyObject *__pyx_n_s_PrettyPrintDic;
static PyObject *__pyx_n_s_PrettyPrintDic_locals_genexpr;
static PyObject *__pyx_n_u_R;
static PyObject *__pyx_n_s_RawConfigParser;
static PyObject *__pyx_n_s_RegFile;
static PyObject *__pyx_n_s_SafeConfigParser;
static PyObject *__pyx_n_s_SetDefaultStyle;
static PyObject *__pyx_n_s_SetTextColour;
static PyObject *__pyx_n_s_ShowPosition;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_SystemExit;
static PyObject *__pyx_n_s_TCR_NOSORT;
static PyObject *__pyx_kp_u_TYPE;
static PyObject *__pyx_n_s_TextColour;
static PyObject *__pyx_n_s_Thread;
static PyObject *__pyx_n_u_True;
static PyObject *__pyx_n_s_TrueToEmpty;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UNDERLINE;
static PyObject *__pyx_kp_u_VALUE;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WARNING;
static PyObject *__pyx_n_s_WriteImage;
static PyObject *__pyx_n_s_WriteText;
static PyObject *__pyx_kp_u__100;
static PyObject *__pyx_n_s__17;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__20;
static PyObject *__pyx_kp_u__24;
static PyObject *__pyx_kp_u__26;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__35;
static PyObject *__pyx_kp_u__46;
static PyObject *__pyx_kp_u__56;
static PyObject *__pyx_kp_u__58;
static PyObject *__pyx_kp_u__66;
static PyObject *__pyx_kp_u__67;
static PyObject *__pyx_n_s__70;
static PyObject *__pyx_n_u__70;
static PyObject *__pyx_kp_u__85;
static PyObject *__pyx_kp_u__86;
static PyObject *__pyx_kp_u__87;
static PyObject *__pyx_kp_u__88;
static PyObject *__pyx_kp_u__89;
static PyObject *__pyx_kp_u__90;
static PyObject *__pyx_kp_u__91;
static PyObject *__pyx_kp_u__92;
static PyObject *__pyx_kp_u__93;
static PyObject *__pyx_kp_u__94;
static PyObject *__pyx_kp_u__95;
static PyObject *__pyx_kp_u__96;
static PyObject *__pyx_kp_u__97;
static PyObject *__pyx_kp_u__98;
static PyObject *__pyx_kp_u__99;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_u_a;
static PyObject *__pyx_kp_u_a_2;
static PyObject *__pyx_n_s_absmax;
static PyObject *__pyx_n_s_abspath;
static PyObject *__pyx_n_s_add2path;
static PyObject *__pyx_n_s_addPythonPath;
static PyObject *__pyx_n_s_addToFileName;
static PyObject *__pyx_n_s_add_section;
static PyObject *__pyx_n_s_addpathlist;
static PyObject *__pyx_n_s_addstr;
static PyObject *__pyx_n_s_adduniqueline;
static PyObject *__pyx_n_s_aleastr;
static PyObject *__pyx_n_s_alevel;
static PyObject *__pyx_n_s_alllist;
static PyObject *__pyx_n_s_analyserange;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_appendex;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_argv;
static PyObject *__pyx_n_s_aset;
static PyObject *__pyx_n_s_aslice;
static PyObject *__pyx_n_s_autoprop;
static PyObject *__pyx_n_s_autoprop___init;
static PyObject *__pyx_n_s_autoprop___init___locals_genexpr;
static PyObject *__pyx_kp_s_autoprop_metaclasse_definissant;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_kp_u_b_2;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_bcolors;
static PyObject *__pyx_n_s_before;
static PyObject *__pyx_n_s_binaries_directory;
static PyObject *__pyx_n_s_binaries_directory_locals_genexp;
static PyObject *__pyx_n_u_black;
static PyObject *__pyx_n_s_blank;
static PyObject *__pyx_n_s_boolstr;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_byref;
static PyObject *__pyx_kp_u_c;
static PyObject *__pyx_n_s_cValues;
static PyObject *__pyx_n_s_c_2;
static PyObject *__pyx_kp_u_c_3;
static PyObject *__pyx_n_s_c_char;
static PyObject *__pyx_n_s_c_double;
static PyObject *__pyx_n_s_cached_listdir;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_s_candidate;
static PyObject *__pyx_n_s_caseSensitive;
static PyObject *__pyx_n_s_casesensitive;
static PyObject *__pyx_n_s_char;
static PyObject *__pyx_n_s_checkFile;
static PyObject *__pyx_n_s_checkIndex;
static PyObject *__pyx_n_s_chemin;
static PyObject *__pyx_n_s_chr;
static PyObject *__pyx_n_s_cible;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_u_class;
static PyObject *__pyx_n_s_cleanDir;
static PyObject *__pyx_n_s_cleanfiles;
static PyObject *__pyx_n_s_cleanfiles_locals_lambda;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_cmp_to_key;
static PyObject *__pyx_n_s_cmp_to_key_locals_K;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___eq;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___ge;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___gt;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___init;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___le;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___lt;
static PyObject *__pyx_n_s_cmp_to_key_locals_K___ne;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_colmem;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_n_u_color;
static PyObject *__pyx_n_s_communicate;
static PyObject *__pyx_n_s_cond;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_configfile;
static PyObject *__pyx_n_s_configparser;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_cp;
static PyObject *__pyx_n_s_createAleaTable;
static PyObject *__pyx_kp_u_creating_s;
static PyObject *__pyx_n_s_criterion;
static PyObject *__pyx_n_u_criterion;
static PyObject *__pyx_n_s_ctypes;
static PyObject *__pyx_n_s_cur;
static PyObject *__pyx_kp_u_d_Z;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_dataIterator;
static PyObject *__pyx_n_s_date0;
static PyObject *__pyx_n_s_datelong;
static PyObject *__pyx_n_s_datelong_locals_setlen2;
static PyObject *__pyx_n_s_datelst;
static PyObject *__pyx_n_s_datestr;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_day;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_defaultedConfigParser;
static PyObject *__pyx_n_s_defconf;
static PyObject *__pyx_n_u_del;
static PyObject *__pyx_kp_u_del__s;
static PyObject *__pyx_n_s_deletefilebyFonction;
static PyObject *__pyx_n_s_deletefilebyFonction_locals_lamb;
static PyObject *__pyx_n_s_df;
static PyObject *__pyx_n_s_dic;
static PyObject *__pyx_n_s_dico;
static PyObject *__pyx_n_s_dico2;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dim;
static PyObject *__pyx_n_s_dir;
static PyObject *__pyx_n_s_dir_path;
static PyObject *__pyx_n_s_direct;
static PyObject *__pyx_n_s_directory;
static PyObject *__pyx_n_s_direxists;
static PyObject *__pyx_n_s_dirloc;
static PyObject *__pyx_n_s_dirname;
static PyObject *__pyx_n_s_dirr;
static PyObject *__pyx_n_s_dirs;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_doc;
static PyObject *__pyx_n_u_doc_2;
static PyObject *__pyx_n_s_doc_3;
static PyObject *__pyx_kp_u_doc__s;
static PyObject *__pyx_n_s_doprint;
static PyObject *__pyx_n_s_dothread;
static PyObject *__pyx_n_s_dothread_locals_wrapper;
static PyObject *__pyx_n_s_dupescape;
static PyObject *__pyx_n_s_endswith;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_environ;
static PyObject *__pyx_n_s_epochs;
static PyObject *__pyx_n_u_epochs;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_s_err;
static PyObject *__pyx_n_s_escape_dict;
static PyObject *__pyx_n_s_estimatedstr;
static PyObject *__pyx_n_s_exec_prefix;
static PyObject *__pyx_n_s_exists;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_expanduser;
static PyObject *__pyx_n_s_ext;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_kp_u_f;
static PyObject *__pyx_n_s_f_2;
static PyObject *__pyx_n_s_fdel;
static PyObject *__pyx_n_s_fdoc;
static PyObject *__pyx_n_s_fget;
static PyObject *__pyx_n_u_file;
static PyObject *__pyx_kp_u_file_s_does_not_exists;
static PyObject *__pyx_n_s_fileexists;
static PyObject *__pyx_n_s_filelist;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_filename2;
static PyObject *__pyx_n_s_files;
static PyObject *__pyx_n_s_filesource;
static PyObject *__pyx_n_s_fillchar;
static PyObject *__pyx_n_s_find;
static PyObject *__pyx_n_s_findall;
static PyObject *__pyx_n_s_firstline;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_fmt;
static PyObject *__pyx_n_s_forbidden;
static PyObject *__pyx_n_s_fset;
static PyObject *__pyx_n_s_full;
static PyObject *__pyx_n_s_fullFileName;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_g;
static PyObject *__pyx_n_s_ge;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get2indexstr;
static PyObject *__pyx_n_s_getCVector;
static PyObject *__pyx_n_s_getFilesByExt;
static PyObject *__pyx_n_s_getIndexInVector;
static PyObject *__pyx_n_s_getOptions;
static PyObject *__pyx_n_s_getPythonPath;
static PyObject *__pyx_n_u_get_2;
static PyObject *__pyx_kp_u_get__s;
static PyObject *__pyx_n_s_getconfigfile;
static PyObject *__pyx_n_s_getexecparam;
static PyObject *__pyx_n_s_getfiletype;
static PyObject *__pyx_n_s_getindexstr;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_gettempdir;
static PyObject *__pyx_n_s_getusersitepackages;
static PyObject *__pyx_n_s_global_cache;
static PyObject *__pyx_n_s_gt;
static PyObject *__pyx_n_s_hasBoolValue;
static PyObject *__pyx_n_s_has_section;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_s_hexstrtoint;
static PyObject *__pyx_n_s_homedir;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_idemDefaultDict;
static PyObject *__pyx_n_s_idemDefaultDict___getitem;
static PyObject *__pyx_n_s_idemDefaultDict___init;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_index1;
static PyObject *__pyx_n_s_index2;
static PyObject *__pyx_n_s_index_2;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_initCount;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_init_original;
static PyObject *__pyx_n_u_initialization;
static PyObject *__pyx_n_s_initstddev;
static PyObject *__pyx_n_u_initstddev;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_instance;
static PyObject *__pyx_n_s_inter;
static PyObject *__pyx_n_s_interrogate;
static PyObject *__pyx_n_s_intro;
static PyObject *__pyx_n_s_inttohexstr;
static PyObject *__pyx_n_s_isdir;
static PyObject *__pyx_n_s_isfield;
static PyObject *__pyx_n_s_isfile;
static PyObject *__pyx_n_s_isiterable;
static PyObject *__pyx_n_s_isnum;
static PyObject *__pyx_n_s_it;
static PyObject *__pyx_n_u_it;
static PyObject *__pyx_n_s_it_2;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iterable;
static PyObject *__pyx_n_s_iterator;
static PyObject *__pyx_n_s_iterlist;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_joinEx;
static PyObject *__pyx_n_s_joinEx_locals_genexpr;
static PyObject *__pyx_n_s_joinEx_locals_modifiedstr;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kw;
static PyObject *__pyx_n_s_kwarg;
static PyObject *__pyx_n_s_kwd;
static PyObject *__pyx_n_s_kwds;
static PyObject *__pyx_kp_u_l;
static PyObject *__pyx_n_s_l_2;
static PyObject *__pyx_n_s_le;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_levelmax;
static PyObject *__pyx_n_s_lf;
static PyObject *__pyx_kp_u_lib_python_s_dist_packages;
static PyObject *__pyx_kp_u_lib_python_s_site_packages;
static PyObject *__pyx_n_s_lim;
static PyObject *__pyx_n_s_limited;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_u_lines;
static PyObject *__pyx_n_s_linker;
static PyObject *__pyx_n_s_linkstr;
static PyObject *__pyx_n_s_listdir;
static PyObject *__pyx_n_s_listorint;
static PyObject *__pyx_n_s_listorstr;
static PyObject *__pyx_n_s_ljust;
static PyObject *__pyx_n_s_ll;
static PyObject *__pyx_n_s_llist;
static PyObject *__pyx_n_s_lmin;
static PyObject *__pyx_kp_u_local_lib_python_s_dist_package;
static PyObject *__pyx_kp_u_local_lib_python_s_site_package;
static PyObject *__pyx_n_s_locationpath;
static PyObject *__pyx_n_s_lookForFile;
static PyObject *__pyx_n_s_lookInTree;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lst;
static PyObject *__pyx_n_s_lst2;
static PyObject *__pyx_n_s_lt;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_u_main;
static PyObject *__pyx_n_s_make_dir;
static PyObject *__pyx_n_s_makedirs;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maxexcluded;
static PyObject *__pyx_n_s_mem;
static PyObject *__pyx_n_s_mess;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metaphor_monal_util_toolbox;
static PyObject *__pyx_kp_s_metaphor_monal_util_toolbox_py;
static PyObject *__pyx_n_s_minincluded;
static PyObject *__pyx_n_s_modifiedstr;
static PyObject *__pyx_n_s_modname;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_n_s_monalconst;
static PyObject *__pyx_n_s_month;
static PyObject *__pyx_n_s_mycmp;
static PyObject *__pyx_n_s_mydir;
static PyObject *__pyx_n_s_myfile;
static PyObject *__pyx_n_s_mytest;
static PyObject *__pyx_kp_u_n;
static PyObject *__pyx_n_s_n_2;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_n_s_namefromfilename;
static PyObject *__pyx_n_s_ne;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_original;
static PyObject *__pyx_n_s_nl;
static PyObject *__pyx_n_s_nline;
static PyObject *__pyx_n_s_nntoolbox_configparsertoolbox;
static PyObject *__pyx_n_s_nntoolbox_utils;
static PyObject *__pyx_n_s_nonZeroToOne;
static PyObject *__pyx_n_s_normcase;
static PyObject *__pyx_n_s_normpath;
static PyObject *__pyx_n_s_nperline;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_opt;
static PyObject *__pyx_n_s_optional;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_package;
static PyObject *__pyx_n_s_packagename;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pathlist;
static PyObject *__pyx_n_s_paths;
static PyObject *__pyx_n_u_paths;
static PyObject *__pyx_n_s_paths_2;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_prefix;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_print_2;
static PyObject *__pyx_n_s_printdoc;
static PyObject *__pyx_n_s_printnl;
static PyObject *__pyx_n_s_product;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_propertyname;
static PyObject *__pyx_n_s_props;
static PyObject *__pyx_n_s_pth;
static PyObject *__pyx_n_s_py_version;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_kp_u_r_2;
static PyObject *__pyx_n_s_randint;
static PyObject *__pyx_n_s_random;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rangestr;
static PyObject *__pyx_n_s_raw;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_recursive;
static PyObject *__pyx_n_s_regFile;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_removelinewith;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_resultdir;
static PyObject *__pyx_n_u_resultdirectory;
static PyObject *__pyx_n_s_reversed;
static PyObject *__pyx_n_s_reversed_enumerate;
static PyObject *__pyx_n_s_rfind;
static PyObject *__pyx_n_s_rmtree;
static PyObject *__pyx_n_s_root;
static PyObject *__pyx_n_s_rrange;
static PyObject *__pyx_n_s_run_script;
static PyObject *__pyx_n_s_save_argv;
static PyObject *__pyx_n_s_script_args;
static PyObject *__pyx_n_s_script_name;
static PyObject *__pyx_n_s_sec;
static PyObject *__pyx_n_s_section;
static PyObject *__pyx_n_s_sections;
static PyObject *__pyx_n_s_seed;
static PyObject *__pyx_n_u_seed;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_n_s_selectedData;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_sep;
static PyObject *__pyx_n_s_seq;
static PyObject *__pyx_n_u_set;
static PyObject *__pyx_n_s_setTrainingActionParams;
static PyObject *__pyx_kp_u_set__s;
static PyObject *__pyx_n_s_setlen2;
static PyObject *__pyx_n_s_shft;
static PyObject *__pyx_n_s_shiftText;
static PyObject *__pyx_n_s_shutil;
static PyObject *__pyx_n_s_singleton;
static PyObject *__pyx_n_s_singleton2;
static PyObject *__pyx_n_s_singleton2_locals_lambda;
static PyObject *__pyx_n_s_singleton_locals_singleton_new;
static PyObject *__pyx_n_s_singleton_new;
static PyObject *__pyx_n_s_site;
static PyObject *__pyx_n_s_six;
static PyObject *__pyx_n_s_slicexrange;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_splitext;
static PyObject *__pyx_n_s_splitfield;
static PyObject *__pyx_n_s_splitlines;
static PyObject *__pyx_n_s_sst;
static PyObject *__pyx_n_s_st;
static PyObject *__pyx_n_s_st2;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stlen;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_strCommon;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_strptime;
static PyObject *__pyx_n_s_strtolen;
static PyObject *__pyx_n_s_subprocess;
static PyObject *__pyx_n_s_suffix;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_kp_u_t_2;
static PyObject *__pyx_n_s_targ;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_temp;
static PyObject *__pyx_n_s_tempDir;
static PyObject *__pyx_n_s_tempFileName;
static PyObject *__pyx_n_s_tempfile;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_s_testresidualstr;
static PyObject *__pyx_n_s_text;
static PyObject *__pyx_n_s_textAttr;
static PyObject *__pyx_n_s_textwriter;
static PyObject *__pyx_n_s_textwriter___init;
static PyObject *__pyx_n_s_textwriter_flush;
static PyObject *__pyx_n_s_textwriter_write;
static PyObject *__pyx_n_s_textwriter_writeImage;
static PyObject *__pyx_n_s_tg;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tilde;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_timestr;
static PyObject *__pyx_n_s_titles;
static PyObject *__pyx_n_u_training;
static PyObject *__pyx_n_u_true;
static PyObject *__pyx_n_s_tt;
static PyObject *__pyx_n_s_unquote;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_updatesection;
static PyObject *__pyx_kp_u_user;
static PyObject *__pyx_kp_u_v;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_vallist;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vector;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_walk;
static PyObject *__pyx_n_s_worksheetstr;
static PyObject *__pyx_n_s_wrapper;
static PyObject *__pyx_n_s_wraps;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_writeImage;
static PyObject *__pyx_n_s_writer;
static PyObject *__pyx_n_s_ww;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_lambda7(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_homedir(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_2cached_listdir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_2__lt__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_4__gt__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_6__eq__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_8__le__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_10__ge__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_12__ne__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_4cmp_to_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mycmp); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_165__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6setTrainingActionParams(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_config, PyObject *__pyx_v_propertyname, PyObject *__pyx_v_initCount, PyObject *__pyx_v_initstddev, PyObject *__pyx_v_epochs, PyObject *__pyx_v_resultdir, PyObject *__pyx_v_seed, PyObject *__pyx_v_criterion, PyObject *__pyx_v_kwd); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8raw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_argv); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10lookInTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_12lookForFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_package, PyObject *__pyx_v_module, PyObject *__pyx_v_optional, PyObject *__pyx_v_abspath, PyObject *__pyx_v_locationpath); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_14addpathlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_packagename, PyObject *__pyx_v_lst); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_16getconfigfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filesource, PyObject *__pyx_v_candidate, PyObject *__pyx_v_modname); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_18getOptions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_configfile, PyObject *__pyx_v_section); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_20getexecparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwarg); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_2writeImage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_4write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_6flush(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_22run_script(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_script_name, PyObject *__pyx_v_script_args); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_24dupescape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_26add2path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_directory); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_28removelinewith(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_test); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_30adduniqueline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_32analyserange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rangestr); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_34getfiletype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_167__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_36make_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir_path, PyObject *__pyx_v_doprint, PyObject *__pyx_v_writer, CYTHON_UNUSED PyObject *__pyx_v_forbidden); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_38tempDir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_40tempFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_length, PyObject *__pyx_v_prefix, PyObject *__pyx_v_suffix); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_42getPythonPath(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_44addPythonPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_before); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_46slicexrange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aslice); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_48alllist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_sep); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_50isfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_52splitfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_54rrange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_57boolstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_59isnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_61appendex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_63NDKdllName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_levelmax, PyObject *__pyx_v_direct); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_65namefromfilename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_67inttohexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_lmin); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_69hexstrtoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_71aleastr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ll); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_73strtolen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_75interrogate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8datelong_setlen2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_st); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_77datelong(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datestr); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_79strCommon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_caseSensitive); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_81getFilesByExt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_directory, PyObject *__pyx_v_ext, PyObject *__pyx_v_casesensitive); /* proto */
static PyObject *__pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15IndexValueError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_mess); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_84getIndexInVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_86getCVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_88product(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iterator, PyObject *__pyx_v_init); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_90getindexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_index, PyObject *__pyx_v_Func); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_92get2indexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index1, PyObject *__pyx_v_index2, PyObject *__pyx_v_Func); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_169__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_94LoadConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_myfile, PyObject *__pyx_v_config); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_96checkIndex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_minincluded, PyObject *__pyx_v_maxexcluded); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_98listorstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cible, PyObject *__pyx_v_sep); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_100listorint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cible); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_102shiftText(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_shft); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8dothread_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_104dothread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_106fileexists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_108direxists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_110checkFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_full); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_112fullFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_chemin); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_114addToFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_addstr); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_116regFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_ext); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_118ContainsAny(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_aset); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_120selectedData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_select, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_122hasBoolValue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_llist, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_124IsValidHour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_timestr, PyObject *__pyx_v_fmt); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_126isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_128stlen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_modifiedstr(PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sep, PyObject *__pyx_v_lim); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_5genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_8genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_130joinEx(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sep, PyObject *__pyx_v_iterator, PyObject *__pyx_v_limited, PyObject *__pyx_v_fillchar); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_132createAleaTable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nline, PyObject *__pyx_v_nperline, PyObject *__pyx_v_absmax); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_134printnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_nl); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_136printdoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_138PrettyPrintDic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dic, PyObject *__pyx_v_intro, PyObject *__pyx_v_inter, PyObject *__pyx_v_dico2); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_140FalseToEmpty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cond); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_142TrueToEmpty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cond); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_144dataIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_titles, PyObject *__pyx_v_iterlist); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_147nonZeroToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_149reversed_enumerate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iterable); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_152_linkstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_linker); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_154singleton2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_9singleton_singleton_new(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_156singleton(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_dico); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_171__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_158deletefilebyFonction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Fct, PyObject *__pyx_v_root, PyObject *__pyx_v_recursive); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_18binaries_directory_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_160binaries_directory(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_162cleanfiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_root, PyObject *__pyx_v_ext); /* proto */
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_3;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_65;
static PyObject *__pyx_int_70;
static PyObject *__pyx_int_90;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_126;
static PyObject *__pyx_int_255;
static PyObject *__pyx_int_1900;
static PyObject *__pyx_int_2000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__19;
static PyObject *__pyx_slice__21;
static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__34;
static PyObject *__pyx_slice__38;
static PyObject *__pyx_slice__39;
static PyObject *__pyx_slice__44;
static PyObject *__pyx_slice__45;
static PyObject *__pyx_slice__48;
static PyObject *__pyx_slice__49;
static PyObject *__pyx_slice__59;
static PyObject *__pyx_slice__78;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_codeobj__4;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__250;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_codeobj__10;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__153;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__163;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__212;
static PyObject *__pyx_codeobj__214;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__247;
static PyObject *__pyx_codeobj__249;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__259;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__275;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__287;
static PyObject *__pyx_codeobj__289;
static PyObject *__pyx_codeobj__291;
/* Late includes */

/* "metaphor/monal/util/toolbox.py":1506
 * #             pprint(*objects, **kwd)
 * 
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):             # <<<<<<<<<<<<<<
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_164lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_164lambda7 = {"lambda7", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_164lambda7, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_164lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_lambda7(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_lambda7(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

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

/* "metaphor/monal/util/toolbox.py":55
 *  #import collections
 * 
 * def homedir():             # <<<<<<<<<<<<<<
 *     return os.path.expanduser(chr(126))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_1homedir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_1homedir = {"homedir", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_1homedir, METH_NOARGS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_1homedir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("homedir (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_homedir(__pyx_self);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_homedir(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("homedir", 0);

  /* "metaphor/monal/util/toolbox.py":56
 * 
 * def homedir():
 *     return os.path.expanduser(chr(126))             # <<<<<<<<<<<<<<
 * 
 * global_cache = {}
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":55
 *  #import collections
 * 
 * def homedir():             # <<<<<<<<<<<<<<
 *     return os.path.expanduser(chr(126))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.homedir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":59
 * 
 * global_cache = {}
 * def cached_listdir(path):             # <<<<<<<<<<<<<<
 *     """Substitute of dircache.listdir for python 3.X
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_3cached_listdir(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_2cached_listdir[] = "Substitute of dircache.listdir for python 3.X\n    ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_3cached_listdir = {"cached_listdir", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_3cached_listdir, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_2cached_listdir};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_3cached_listdir(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cached_listdir (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_2cached_listdir(__pyx_self, ((PyObject *)__pyx_v_path));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_2cached_listdir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("cached_listdir", 0);

  /* "metaphor/monal/util/toolbox.py":62
 *     """Substitute of dircache.listdir for python 3.X
 *     """
 *     res = global_cache.get(path)             # <<<<<<<<<<<<<<
 *     if res is None:
 *         res = os.listdir(path)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_global_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_path);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __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_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":63
 *     """
 *     res = global_cache.get(path)
 *     if res is None:             # <<<<<<<<<<<<<<
 *         res = os.listdir(path)
 *         global_cache[path] = res
 */
  __pyx_t_5 = (__pyx_v_res == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "metaphor/monal/util/toolbox.py":64
 *     res = global_cache.get(path)
 *     if res is None:
 *         res = os.listdir(path)             # <<<<<<<<<<<<<<
 *         global_cache[path] = res
 *     return res
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_listdir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_path);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":65
 *     if res is None:
 *         res = os.listdir(path)
 *         global_cache[path] = res             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_global_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_path, __pyx_v_res) < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":63
 *     """
 *     res = global_cache.get(path)
 *     if res is None:             # <<<<<<<<<<<<<<
 *         res = os.listdir(path)
 *         global_cache[path] = res
 */
  }

  /* "metaphor/monal/util/toolbox.py":66
 *         res = os.listdir(path)
 *         global_cache[path] = res
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # def orderedIndexes(iterable, increase=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":59
 * 
 * global_cache = {}
 * def cached_listdir(path):             # <<<<<<<<<<<<<<
 *     """Substitute of dircache.listdir for python 3.X
 *     """
 */

  /* function 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("metaphor.monal.util.toolbox.cached_listdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_5cmp_to_key(PyObject *__pyx_self, PyObject *__pyx_v_mycmp); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_4cmp_to_key[] = "Convert a cmp= function into a key= function";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_5cmp_to_key = {"cmp_to_key", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_5cmp_to_key, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_4cmp_to_key};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_5cmp_to_key(PyObject *__pyx_self, PyObject *__pyx_v_mycmp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cmp_to_key (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_4cmp_to_key(__pyx_self, ((PyObject *)__pyx_v_mycmp));

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

/* "metaphor/monal/util/toolbox.py":92
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 *         def __init__(self, obj, *args):             # <<<<<<<<<<<<<<
 *             self.obj = obj
 *         def __lt__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_obj = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_obj,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) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); __PYX_ERR(0, 92, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 92, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 92, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K___init__(__pyx_self, __pyx_v_self, __pyx_v_obj, __pyx_v_args);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "metaphor/monal/util/toolbox.py":93
 *     class K(object):
 *         def __init__(self, obj, *args):
 *             self.obj = obj             # <<<<<<<<<<<<<<
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 93, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":92
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 *         def __init__(self, obj, *args):             # <<<<<<<<<<<<<<
 *             self.obj = obj
 *         def __lt__(self, other):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":94
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 *         def __lt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_3__lt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_3__lt__ = {"__lt__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_3__lt__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_3__lt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lt__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__lt__", 1, 2, 2, 1); __PYX_ERR(0, 94, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__lt__") < 0)) __PYX_ERR(0, 94, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__lt__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 94, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__lt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_2__lt__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_2__lt__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__lt__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":95
 *             self.obj = obj
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0             # <<<<<<<<<<<<<<
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 95, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 95, __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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":94
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 *         def __lt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__lt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":96
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_5__gt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_5__gt__ = {"__gt__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_5__gt__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_5__gt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__gt__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__gt__", 1, 2, 2, 1); __PYX_ERR(0, 96, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__gt__") < 0)) __PYX_ERR(0, 96, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__gt__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__gt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_4__gt__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_4__gt__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__gt__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":97
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0             # <<<<<<<<<<<<<<
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 97, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 97, __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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":96
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__gt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":98
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_7__eq__ = {"__eq__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_7__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 98, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_6__eq__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":99
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0             # <<<<<<<<<<<<<<
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 99, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 99, __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_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":98
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":100
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_9__le__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_9__le__ = {"__le__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_9__le__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_9__le__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__le__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__le__", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__le__") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__le__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__le__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_8__le__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_8__le__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__le__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":101
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0             # <<<<<<<<<<<<<<
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 101, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 101, __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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":100
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__le__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":102
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_11__ge__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_11__ge__ = {"__ge__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_11__ge__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_11__ge__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ge__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ge__", 1, 2, 2, 1); __PYX_ERR(0, 102, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ge__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ge__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__ge__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_10__ge__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_10__ge__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__ge__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":103
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0             # <<<<<<<<<<<<<<
 *         def __ne__(self, other):
 *             return mycmp(self.obj, other.obj) != 0
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 103, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 103, __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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":102
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__ge__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":104
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) != 0
 *     return K
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_13__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_13__ne__ = {"__ne__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_13__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_13__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 104, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_12__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_12__ne__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__ne__", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":105
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):
 *             return mycmp(self.obj, other.obj) != 0             # <<<<<<<<<<<<<<
 *     return K
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mycmp)) { __Pyx_RaiseClosureNameError("mycmp"); __PYX_ERR(0, 105, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_mycmp; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __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_ERR(0, 105, __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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":104
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) != 0
 *     return K
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key.K.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_4cmp_to_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mycmp) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_cur_scope;
  PyObject *__pyx_v_K = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("cmp_to_key", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 89, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_mycmp = __pyx_v_mycmp;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mycmp);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_mycmp);

  /* "metaphor/monal/util/toolbox.py":91
 * def cmp_to_key(mycmp):
 *     'Convert a cmp= function into a key= function'
 *     class K(object):             # <<<<<<<<<<<<<<
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__2, __pyx_n_s_K, __pyx_n_s_cmp_to_key_locals_K, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "metaphor/monal/util/toolbox.py":92
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 *         def __init__(self, obj, *args):             # <<<<<<<<<<<<<<
 *             self.obj = obj
 *         def __lt__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_1__init__, 0, __pyx_n_s_cmp_to_key_locals_K___init, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":94
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 *         def __lt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_3__lt__, 0, __pyx_n_s_cmp_to_key_locals_K___lt, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_lt, __pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":96
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_5__gt__, 0, __pyx_n_s_cmp_to_key_locals_K___gt, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_gt, __pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":98
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_7__eq__, 0, __pyx_n_s_cmp_to_key_locals_K___eq, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_eq, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":100
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_9__le__, 0, __pyx_n_s_cmp_to_key_locals_K___le, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_le, __pyx_t_3) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":102
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_11__ge__, 0, __pyx_n_s_cmp_to_key_locals_K___ge, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ge, __pyx_t_3) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":104
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) != 0
 *     return K
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cmp_to_key_1K_13__ne__, 0, __pyx_n_s_cmp_to_key_locals_K___ne, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ne, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":91
 * def cmp_to_key(mycmp):
 *     'Convert a cmp= function into a key= function'
 *     class K(object):             # <<<<<<<<<<<<<<
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_K, __pyx_tuple__2, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_K = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":106
 *         def __ne__(self, other):
 *             return mycmp(self.obj, other.obj) != 0
 *     return K             # <<<<<<<<<<<<<<
 * 
 * tilde = chr(0x007E)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_K);
  __pyx_r = __pyx_v_K;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cmp_to_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_K);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":142
 * #     return st
 * #
 * def setTrainingActionParams(config, propertyname, initCount=1, initstddev=0.3,             # <<<<<<<<<<<<<<
 *         epochs=0, resultdir="", seed=0, criterion=C.TCR_NOSORT, **kwd):
 *     """Introducing the training parameters in the configuration object.
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_165__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_1));
  __Pyx_INCREF(((PyObject*)__pyx_float_0_3));
  __Pyx_GIVEREF(((PyObject*)__pyx_float_0_3));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_float_0_3));
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_0));
  __Pyx_INCREF(((PyObject*)__pyx_kp_u__17));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_u__17));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject*)__pyx_kp_u__17));
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_int_0));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_criterion);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_criterion);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_criterion);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_7setTrainingActionParams(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_6setTrainingActionParams[] = "Introducing the training parameters in the configuration object.\n    \n    Allowed parameters are :\n    \n    - propertyname -> \n    \n    - initCount=1  -> \n    \n    - initstddev=0.3 -> \n    \n    - epochs=0  -> \n\n    - resultdir=\"\" -> \n    \n    - seed=0,  -> \n    \n    - criterion=C.TCR_NOSORT -> \n    \n    kwd is an optional dictionary to initiate the parameters.\n    ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_7setTrainingActionParams = {"setTrainingActionParams", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_7setTrainingActionParams, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_6setTrainingActionParams};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_7setTrainingActionParams(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_config = 0;
  PyObject *__pyx_v_propertyname = 0;
  PyObject *__pyx_v_initCount = 0;
  PyObject *__pyx_v_initstddev = 0;
  PyObject *__pyx_v_epochs = 0;
  PyObject *__pyx_v_resultdir = 0;
  PyObject *__pyx_v_seed = 0;
  PyObject *__pyx_v_criterion = 0;
  PyObject *__pyx_v_kwd = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setTrainingActionParams (wrapper)", 0);
  __pyx_v_kwd = PyDict_New(); if (unlikely(!__pyx_v_kwd)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwd);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_config,&__pyx_n_s_propertyname,&__pyx_n_s_initCount,&__pyx_n_s_initstddev,&__pyx_n_s_epochs,&__pyx_n_s_resultdir,&__pyx_n_s_seed,&__pyx_n_s_criterion,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)__pyx_int_1));
    values[3] = ((PyObject *)((PyObject*)__pyx_float_0_3));
    values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[5] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[6] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[7] = __pyx_dynamic_args->__pyx_arg_criterion;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_config)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_propertyname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setTrainingActionParams", 0, 2, 8, 1); __PYX_ERR(0, 142, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initCount);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initstddev);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_epochs);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resultdir);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_criterion);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwd, values, pos_args, "setTrainingActionParams") < 0)) __PYX_ERR(0, 142, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_config = values[0];
    __pyx_v_propertyname = values[1];
    __pyx_v_initCount = values[2];
    __pyx_v_initstddev = values[3];
    __pyx_v_epochs = values[4];
    __pyx_v_resultdir = values[5];
    __pyx_v_seed = values[6];
    __pyx_v_criterion = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTrainingActionParams", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 142, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwd); __pyx_v_kwd = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.setTrainingActionParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_6setTrainingActionParams(__pyx_self, __pyx_v_config, __pyx_v_propertyname, __pyx_v_initCount, __pyx_v_initstddev, __pyx_v_epochs, __pyx_v_resultdir, __pyx_v_seed, __pyx_v_criterion, __pyx_v_kwd);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6setTrainingActionParams(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_config, PyObject *__pyx_v_propertyname, PyObject *__pyx_v_initCount, PyObject *__pyx_v_initstddev, PyObject *__pyx_v_epochs, PyObject *__pyx_v_resultdir, PyObject *__pyx_v_seed, PyObject *__pyx_v_criterion, PyObject *__pyx_v_kwd) {
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_v_dic = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("setTrainingActionParams", 0);
  __Pyx_INCREF(__pyx_v_config);

  /* "metaphor/monal/util/toolbox.py":164
 *     kwd is an optional dictionary to initiate the parameters.
 *     """
 *     if config is None:             # <<<<<<<<<<<<<<
 *         config = defaultedConfigParser()
 *     assert(isinstance(config, defaultedConfigParser))
 */
  __pyx_t_1 = (__pyx_v_config == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":165
 *     """
 *     if config is None:
 *         config = defaultedConfigParser()             # <<<<<<<<<<<<<<
 *     assert(isinstance(config, defaultedConfigParser))
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultedConfigParser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":164
 *     kwd is an optional dictionary to initiate the parameters.
 *     """
 *     if config is None:             # <<<<<<<<<<<<<<
 *         config = defaultedConfigParser()
 *     assert(isinstance(config, defaultedConfigParser))
 */
  }

  /* "metaphor/monal/util/toolbox.py":166
 *     if config is None:
 *         config = defaultedConfigParser()
 *     assert(isinstance(config, defaultedConfigParser))             # <<<<<<<<<<<<<<
 * 
 *     st = _linkstr("training", propertyname) if propertyname else "training"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultedConfigParser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_config, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!(__pyx_t_2 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 166, __pyx_L1_error)
    }
  }
  #endif

  /* "metaphor/monal/util/toolbox.py":168
 *     assert(isinstance(config, defaultedConfigParser))
 * 
 *     st = _linkstr("training", propertyname) if propertyname else "training"             # <<<<<<<<<<<<<<
 *     if not config.has_section(st):
 *         config.add_section(st)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_propertyname); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_linkstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_training, __pyx_v_propertyname};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_training, __pyx_v_propertyname};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_training);
      __Pyx_GIVEREF(__pyx_n_u_training);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_n_u_training);
      __Pyx_INCREF(__pyx_v_propertyname);
      __Pyx_GIVEREF(__pyx_v_propertyname);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_propertyname);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_n_u_training);
    __pyx_t_3 = __pyx_n_u_training;
  }
  __pyx_v_st = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":169
 * 
 *     st = _linkstr("training", propertyname) if propertyname else "training"
 *     if not config.has_section(st):             # <<<<<<<<<<<<<<
 *         config.add_section(st)
 *     dic = {}
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_has_section); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_st};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_st};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_st);
      __Pyx_GIVEREF(__pyx_v_st);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_st);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":170
 *     st = _linkstr("training", propertyname) if propertyname else "training"
 *     if not config.has_section(st):
 *         config.add_section(st)             # <<<<<<<<<<<<<<
 *     dic = {}
 *     if kwd:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_add_section); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_st};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_st};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_st);
        __Pyx_GIVEREF(__pyx_v_st);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_st);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __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;

    /* "metaphor/monal/util/toolbox.py":169
 * 
 *     st = _linkstr("training", propertyname) if propertyname else "training"
 *     if not config.has_section(st):             # <<<<<<<<<<<<<<
 *         config.add_section(st)
 *     dic = {}
 */
  }

  /* "metaphor/monal/util/toolbox.py":171
 *     if not config.has_section(st):
 *         config.add_section(st)
 *     dic = {}             # <<<<<<<<<<<<<<
 *     if kwd:
 *         dic.update(kwd)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dic = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":172
 *         config.add_section(st)
 *     dic = {}
 *     if kwd:             # <<<<<<<<<<<<<<
 *         dic.update(kwd)
 *     dic.update({
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kwd); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":173
 *     dic = {}
 *     if kwd:
 *         dic.update(kwd)             # <<<<<<<<<<<<<<
 *     dic.update({
 *         "initialization": initCount,
 */
    __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_dic, __pyx_v_kwd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":172
 *         config.add_section(st)
 *     dic = {}
 *     if kwd:             # <<<<<<<<<<<<<<
 *         dic.update(kwd)
 *     dic.update({
 */
  }

  /* "metaphor/monal/util/toolbox.py":175
 *         dic.update(kwd)
 *     dic.update({
 *         "initialization": initCount,             # <<<<<<<<<<<<<<
 *         "initstddev": initstddev,
 *         "epochs": epochs,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_initialization, __pyx_v_initCount) < 0) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":176
 *     dic.update({
 *         "initialization": initCount,
 *         "initstddev": initstddev,             # <<<<<<<<<<<<<<
 *         "epochs": epochs,
 *         "resultdirectory": resultdir,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_initstddev, __pyx_v_initstddev) < 0) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":177
 *         "initialization": initCount,
 *         "initstddev": initstddev,
 *         "epochs": epochs,             # <<<<<<<<<<<<<<
 *         "resultdirectory": resultdir,
 *         "seed": seed})
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_epochs, __pyx_v_epochs) < 0) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":178
 *         "initstddev": initstddev,
 *         "epochs": epochs,
 *         "resultdirectory": resultdir,             # <<<<<<<<<<<<<<
 *         "seed": seed})
 *     if criterion != C.TCR_NOSORT:
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_resultdirectory, __pyx_v_resultdir) < 0) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":179
 *         "epochs": epochs,
 *         "resultdirectory": resultdir,
 *         "seed": seed})             # <<<<<<<<<<<<<<
 *     if criterion != C.TCR_NOSORT:
 *         dic["criterion"] = criterion
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_seed, __pyx_v_seed) < 0) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":174
 *     if kwd:
 *         dic.update(kwd)
 *     dic.update({             # <<<<<<<<<<<<<<
 *         "initialization": initCount,
 *         "initstddev": initstddev,
 */
  __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_dic, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":180
 *         "resultdirectory": resultdir,
 *         "seed": seed})
 *     if criterion != C.TCR_NOSORT:             # <<<<<<<<<<<<<<
 *         dic["criterion"] = criterion
 *     config.updatesection(st, **dic)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_TCR_NOSORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_criterion, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":181
 *         "seed": seed})
 *     if criterion != C.TCR_NOSORT:
 *         dic["criterion"] = criterion             # <<<<<<<<<<<<<<
 *     config.updatesection(st, **dic)
 *     return config
 */
    if (unlikely(PyDict_SetItem(__pyx_v_dic, __pyx_n_u_criterion, __pyx_v_criterion) < 0)) __PYX_ERR(0, 181, __pyx_L1_error)

    /* "metaphor/monal/util/toolbox.py":180
 *         "resultdirectory": resultdir,
 *         "seed": seed})
 *     if criterion != C.TCR_NOSORT:             # <<<<<<<<<<<<<<
 *         dic["criterion"] = criterion
 *     config.updatesection(st, **dic)
 */
  }

  /* "metaphor/monal/util/toolbox.py":182
 *     if criterion != C.TCR_NOSORT:
 *         dic["criterion"] = criterion
 *     config.updatesection(st, **dic)             # <<<<<<<<<<<<<<
 *     return config
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_updatesection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_st);
  __Pyx_GIVEREF(__pyx_v_st);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_st);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_v_dic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/monal/util/toolbox.py":183
 *         dic["criterion"] = criterion
 *     config.updatesection(st, **dic)
 *     return config             # <<<<<<<<<<<<<<
 * 
 * def raw(text):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_config);
  __pyx_r = __pyx_v_config;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":142
 * #     return st
 * #
 * def setTrainingActionParams(config, propertyname, initCount=1, initstddev=0.3,             # <<<<<<<<<<<<<<
 *         epochs=0, resultdir="", seed=0, criterion=C.TCR_NOSORT, **kwd):
 *     """Introducing the training parameters in the configuration object.
 */

  /* 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_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.setTrainingActionParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_dic);
  __Pyx_XDECREF(__pyx_v_config);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":185
 *     return config
 * 
 * def raw(text):             # <<<<<<<<<<<<<<
 *     """Returns a raw string representation of text"""
 *     return "".join([escape_dict.get(char, char) for char in text])
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_9raw(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_8raw[] = "Returns a raw string representation of text";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_9raw = {"raw", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_9raw, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_8raw};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_9raw(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("raw (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_8raw(__pyx_self, ((PyObject *)__pyx_v_text));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8raw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_7genexpr__pyx_v_char = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("raw", 0);

  /* "metaphor/monal/util/toolbox.py":187
 * def raw(text):
 *     """Returns a raw string representation of text"""
 *     return "".join([escape_dict.get(char, char) for char in text])             # <<<<<<<<<<<<<<
 * 
 * class idemDefaultDict(dict):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_text)) || PyTuple_CheckExact(__pyx_v_text)) {
      __pyx_t_2 = __pyx_v_text; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 187, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 187, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 187, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_char, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_escape_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_7genexpr__pyx_v_char, __pyx_7genexpr__pyx_v_char};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L5_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_7genexpr__pyx_v_char, __pyx_7genexpr__pyx_v_char};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L5_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_7genexpr__pyx_v_char);
        __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_char);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_7genexpr__pyx_v_char);
        __Pyx_INCREF(__pyx_7genexpr__pyx_v_char);
        __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_char);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_7genexpr__pyx_v_char);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 187, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_char); __pyx_7genexpr__pyx_v_char = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_char); __pyx_7genexpr__pyx_v_char = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":185
 *     return config
 * 
 * def raw(text):             # <<<<<<<<<<<<<<
 *     """Returns a raw string representation of text"""
 *     return "".join([escape_dict.get(char, char) for char in text])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.raw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_char);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":192
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 *     def __init__(self, *args, **argv):             # <<<<<<<<<<<<<<
 *         super(idemDefaultDict, self).__init__()
 *         self.update(*args, **argv)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_argv = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_argv = PyDict_New(); if (unlikely(!__pyx_v_argv)) return NULL;
  __Pyx_GOTREF(__pyx_v_argv);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_argv); __pyx_v_argv = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_argv, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 192, __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_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 192, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_argv); __pyx_v_argv = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.idemDefaultDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_argv);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_argv) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "metaphor/monal/util/toolbox.py":193
 *     """
 *     def __init__(self, *args, **argv):
 *         super(idemDefaultDict, self).__init__()             # <<<<<<<<<<<<<<
 *         self.update(*args, **argv)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_idemDefaultDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":194
 *     def __init__(self, *args, **argv):
 *         super(idemDefaultDict, self).__init__()
 *         self.update(*args, **argv)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_argv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":192
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 *     def __init__(self, *args, **argv):             # <<<<<<<<<<<<<<
 *         super(idemDefaultDict, self).__init__()
 *         self.update(*args, **argv)
 */

  /* 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("metaphor.monal.util.toolbox.idemDefaultDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":196
 *         self.update(*args, **argv)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_3__getitem__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.idemDefaultDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "metaphor/monal/util/toolbox.py":197
 * 
 *     def __getitem__(self, key):
 *         try:             # <<<<<<<<<<<<<<
 *             return super(idemDefaultDict, self).__getitem__(key)
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":198
 *     def __getitem__(self, key):
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             return key
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_idemDefaultDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getitem); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_key};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_key};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_key);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":197
 * 
 *     def __getitem__(self, key):
 *         try:             # <<<<<<<<<<<<<<
 *             return super(idemDefaultDict, self).__getitem__(key)
 *         except KeyError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":199
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             return key
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.idemDefaultDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 199, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "metaphor/monal/util/toolbox.py":200
 *             return super(idemDefaultDict, self).__getitem__(key)
 *         except KeyError:
 *             return key             # <<<<<<<<<<<<<<
 * 
 * # def max Workers(value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_key);
      __pyx_r = __pyx_v_key;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":197
 * 
 *     def __getitem__(self, key):
 *         try:             # <<<<<<<<<<<<<<
 *             return super(idemDefaultDict, self).__getitem__(key)
 *         except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":196
 *         self.update(*args, **argv)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.idemDefaultDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":212
 * #     return val
 * 
 * def lookInTree(filename, base):             # <<<<<<<<<<<<<<
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_11lookInTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_11lookInTree = {"lookInTree", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_11lookInTree, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_11lookInTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookInTree (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_base,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lookInTree", 1, 2, 2, 1); __PYX_ERR(0, 212, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookInTree") < 0)) __PYX_ERR(0, 212, __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_base = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookInTree", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.lookInTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10lookInTree(__pyx_self, __pyx_v_filename, __pyx_v_base);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10lookInTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_root = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_filelist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  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)(PyObject *);
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("lookInTree", 0);
  __Pyx_INCREF(__pyx_v_base);

  /* "metaphor/monal/util/toolbox.py":213
 * 
 * def lookInTree(filename, base):
 *     if not isinstance(base, str):             # <<<<<<<<<<<<<<
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_base); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":214
 * def lookInTree(filename, base):
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]             # <<<<<<<<<<<<<<
 *     for root, _, filelist in os.walk(base):  #dirlist
 *         if filename in filelist:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_paths); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_base, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":213
 * 
 * def lookInTree(filename, base):
 *     if not isinstance(base, str):             # <<<<<<<<<<<<<<
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist
 */
  }

  /* "metaphor/monal/util/toolbox.py":215
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist             # <<<<<<<<<<<<<<
 *         if filename in filelist:
 *             return os.path.join(root, filename)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_walk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_base};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_base};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_base);
      __Pyx_GIVEREF(__pyx_v_base);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_base);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  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_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(0, 215, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 215, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 215, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 215, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_root, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_filelist, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "metaphor/monal/util/toolbox.py":216
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist
 *         if filename in filelist:             # <<<<<<<<<<<<<<
 *             return os.path.join(root, filename)
 * #         for dirr in dirlist:
 */
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_filename, __pyx_v_filelist, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 216, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":217
 *     for root, _, filelist in os.walk(base):  #dirlist
 *         if filename in filelist:
 *             return os.path.join(root, filename)             # <<<<<<<<<<<<<<
 * #         for dirr in dirlist:
 * #             st = lookInTree(filename, dirr)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_root, __pyx_v_filename};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_root, __pyx_v_filename};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_root);
        __Pyx_GIVEREF(__pyx_v_root);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_12, __pyx_v_root);
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_12, __pyx_v_filename);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "metaphor/monal/util/toolbox.py":216
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist
 *         if filename in filelist:             # <<<<<<<<<<<<<<
 *             return os.path.join(root, filename)
 * #         for dirr in dirlist:
 */
    }

    /* "metaphor/monal/util/toolbox.py":215
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 *     for root, _, filelist in os.walk(base):  #dirlist             # <<<<<<<<<<<<<<
 *         if filename in filelist:
 *             return os.path.join(root, filename)
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/monal/util/toolbox.py":212
 * #     return val
 * 
 * def lookInTree(filename, base):             # <<<<<<<<<<<<<<
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.lookInTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_filelist);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":223
 * #                 return st
 * 
 * def lookForFile(filename, package, module="", optional="", abspath=False, locationpath=""):             # <<<<<<<<<<<<<<
 *     """Recherche un fichier dans un package, et dans les enfants de ses ancetres
 *     portant le meme nom
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_13lookForFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_12lookForFile[] = "Recherche un fichier dans un package, et dans les enfants de ses ancetres \n    portant le meme nom\n    ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_13lookForFile = {"lookForFile", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_13lookForFile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_12lookForFile};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_13lookForFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_package = 0;
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_optional = 0;
  PyObject *__pyx_v_abspath = 0;
  PyObject *__pyx_v_locationpath = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookForFile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_package,&__pyx_n_s_module_2,&__pyx_n_s_optional,&__pyx_n_s_abspath,&__pyx_n_s_locationpath,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[3] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_package)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lookForFile", 0, 2, 6, 1); __PYX_ERR(0, 223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_module_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_optional);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_abspath);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_locationpath);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookForFile") < 0)) __PYX_ERR(0, 223, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_package = values[1];
    __pyx_v_module = values[2];
    __pyx_v_optional = values[3];
    __pyx_v_abspath = values[4];
    __pyx_v_locationpath = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookForFile", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 223, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.lookForFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_12lookForFile(__pyx_self, __pyx_v_filename, __pyx_v_package, __pyx_v_module, __pyx_v_optional, __pyx_v_abspath, __pyx_v_locationpath);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_12lookForFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_package, PyObject *__pyx_v_module, PyObject *__pyx_v_optional, PyObject *__pyx_v_abspath, PyObject *__pyx_v_locationpath) {
  PyObject *__pyx_v_filename2 = NULL;
  PyObject *__pyx_v_test = NULL;
  PyObject *__pyx_v_pathlist = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_base = NULL;
  PyObject *__pyx_v_root = NULL;
  PyObject *__pyx_v_dirs = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_mydir = NULL;
  PyObject *__pyx_v_mytest = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  __Pyx_RefNannySetupContext("lookForFile", 0);

  /* "metaphor/monal/util/toolbox.py":227
 *     portant le meme nom
 *     """
 *     if locationpath:             # <<<<<<<<<<<<<<
 *         filename2 = os.path.join(locationpath, filename)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_locationpath); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 227, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":228
 *     """
 *     if locationpath:
 *         filename2 = os.path.join(locationpath, filename)             # <<<<<<<<<<<<<<
 *     else:
 *         filename2 = filename
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_locationpath, __pyx_v_filename};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_locationpath, __pyx_v_filename};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_locationpath);
      __Pyx_GIVEREF(__pyx_v_locationpath);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_locationpath);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_filename);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_filename2 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":227
 *     portant le meme nom
 *     """
 *     if locationpath:             # <<<<<<<<<<<<<<
 *         filename2 = os.path.join(locationpath, filename)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "metaphor/monal/util/toolbox.py":230
 *         filename2 = os.path.join(locationpath, filename)
 *     else:
 *         filename2 = filename             # <<<<<<<<<<<<<<
 *     if os.path.exists(filename2):
 *         if abspath and os.path.exists(filename2):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_filename);
    __pyx_v_filename2 = __pyx_v_filename;
  }
  __pyx_L3:;

  /* "metaphor/monal/util/toolbox.py":231
 *     else:
 *         filename2 = filename
 *     if os.path.exists(filename2):             # <<<<<<<<<<<<<<
 *         if abspath and os.path.exists(filename2):
 *             return os.path.abspath(filename2)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_filename2};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_filename2};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_filename2);
      __Pyx_GIVEREF(__pyx_v_filename2);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename2);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":232
 *         filename2 = filename
 *     if os.path.exists(filename2):
 *         if abspath and os.path.exists(filename2):             # <<<<<<<<<<<<<<
 *             return os.path.abspath(filename2)
 *         else:
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_abspath); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename2};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename2};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_filename2);
        __Pyx_GIVEREF(__pyx_v_filename2);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filename2);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":233
 *     if os.path.exists(filename2):
 *         if abspath and os.path.exists(filename2):
 *             return os.path.abspath(filename2)             # <<<<<<<<<<<<<<
 *         else:
 *             return filename2
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_abspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_filename2};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_filename2};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_v_filename2);
          __Pyx_GIVEREF(__pyx_v_filename2);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename2);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "metaphor/monal/util/toolbox.py":232
 *         filename2 = filename
 *     if os.path.exists(filename2):
 *         if abspath and os.path.exists(filename2):             # <<<<<<<<<<<<<<
 *             return os.path.abspath(filename2)
 *         else:
 */
    }

    /* "metaphor/monal/util/toolbox.py":235
 *             return os.path.abspath(filename2)
 *         else:
 *             return filename2             # <<<<<<<<<<<<<<
 * #         return filename
 *     test = ""
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_filename2);
      __pyx_r = __pyx_v_filename2;
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":231
 *     else:
 *         filename2 = filename
 *     if os.path.exists(filename2):             # <<<<<<<<<<<<<<
 *         if abspath and os.path.exists(filename2):
 *             return os.path.abspath(filename2)
 */
  }

  /* "metaphor/monal/util/toolbox.py":237
 *             return filename2
 * #         return filename
 *     test = ""             # <<<<<<<<<<<<<<
 *     try:
 *         pathlist = package.__paths__
 */
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_v_test = __pyx_kp_u__17;

  /* "metaphor/monal/util/toolbox.py":238
 * #         return filename
 *     test = ""
 *     try:             # <<<<<<<<<<<<<<
 *         pathlist = package.__paths__
 *     except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":239
 *     test = ""
 *     try:
 *         pathlist = package.__paths__             # <<<<<<<<<<<<<<
 *     except:
 *         pathlist = []
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_package, __pyx_n_s_paths); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_pathlist = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "metaphor/monal/util/toolbox.py":238
 * #         return filename
 *     test = ""
 *     try:             # <<<<<<<<<<<<<<
 *         pathlist = package.__paths__
 *     except:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L13_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":240
 *     try:
 *         pathlist = package.__paths__
 *     except:             # <<<<<<<<<<<<<<
 *         pathlist = []
 *         if hasattr(package, "__paths__"):
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.lookForFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 240, __pyx_L10_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);

      /* "metaphor/monal/util/toolbox.py":241
 *         pathlist = package.__paths__
 *     except:
 *         pathlist = []             # <<<<<<<<<<<<<<
 *         if hasattr(package, "__paths__"):
 *             pathlist = getattr(package, "__paths__")
 */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L10_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_pathlist, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "metaphor/monal/util/toolbox.py":242
 *     except:
 *         pathlist = []
 *         if hasattr(package, "__paths__"):             # <<<<<<<<<<<<<<
 *             pathlist = getattr(package, "__paths__")
 *     for val in pathlist:
 */
      __pyx_t_1 = __Pyx_HasAttr(__pyx_v_package, __pyx_n_u_paths); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 242, __pyx_L10_except_error)
      __pyx_t_7 = (__pyx_t_1 != 0);
      if (__pyx_t_7) {

        /* "metaphor/monal/util/toolbox.py":243
 *         pathlist = []
 *         if hasattr(package, "__paths__"):
 *             pathlist = getattr(package, "__paths__")             # <<<<<<<<<<<<<<
 *     for val in pathlist:
 *         base = os.path.join(val, module, filename)
 */
        __pyx_t_6 = __Pyx_GetAttr(__pyx_v_package, __pyx_n_u_paths); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF_SET(__pyx_v_pathlist, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "metaphor/monal/util/toolbox.py":242
 *     except:
 *         pathlist = []
 *         if hasattr(package, "__paths__"):             # <<<<<<<<<<<<<<
 *             pathlist = getattr(package, "__paths__")
 *     for val in pathlist:
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;

    /* "metaphor/monal/util/toolbox.py":238
 * #         return filename
 *     test = ""
 *     try:             # <<<<<<<<<<<<<<
 *         pathlist = package.__paths__
 *     except:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L13_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":244
 *         if hasattr(package, "__paths__"):
 *             pathlist = getattr(package, "__paths__")
 *     for val in pathlist:             # <<<<<<<<<<<<<<
 *         base = os.path.join(val, module, filename)
 *         if os.path.exists(base):
 */
  if (likely(PyList_CheckExact(__pyx_v_pathlist)) || PyTuple_CheckExact(__pyx_v_pathlist)) {
    __pyx_t_4 = __pyx_v_pathlist; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_pathlist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_12(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 244, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":245
 *             pathlist = getattr(package, "__paths__")
 *     for val in pathlist:
 *         base = os.path.join(val, module, filename)             # <<<<<<<<<<<<<<
 *         if os.path.exists(base):
 *             test = base;
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_val, __pyx_v_module, __pyx_v_filename};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_val, __pyx_v_module, __pyx_v_filename};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_13 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_v_val);
      __Pyx_INCREF(__pyx_v_module);
      __Pyx_GIVEREF(__pyx_v_module);
      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, __pyx_v_module);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_5, __pyx_v_filename);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":246
 *     for val in pathlist:
 *         base = os.path.join(val, module, filename)
 *         if os.path.exists(base):             # <<<<<<<<<<<<<<
 *             test = base;
 *             break
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_13) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_base};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_base};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
        __Pyx_INCREF(__pyx_v_base);
        __Pyx_GIVEREF(__pyx_v_base);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_base);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {

      /* "metaphor/monal/util/toolbox.py":247
 *         base = os.path.join(val, module, filename)
 *         if os.path.exists(base):
 *             test = base;             # <<<<<<<<<<<<<<
 *             break
 *     if not test and optional:
 */
      __Pyx_INCREF(__pyx_v_base);
      __Pyx_DECREF_SET(__pyx_v_test, __pyx_v_base);

      /* "metaphor/monal/util/toolbox.py":248
 *         if os.path.exists(base):
 *             test = base;
 *             break             # <<<<<<<<<<<<<<
 *     if not test and optional:
 *         for val in pathlist:
 */
      goto __pyx_L18_break;

      /* "metaphor/monal/util/toolbox.py":246
 *     for val in pathlist:
 *         base = os.path.join(val, module, filename)
 *         if os.path.exists(base):             # <<<<<<<<<<<<<<
 *             test = base;
 *             break
 */
    }

    /* "metaphor/monal/util/toolbox.py":244
 *         if hasattr(package, "__paths__"):
 *             pathlist = getattr(package, "__paths__")
 *     for val in pathlist:             # <<<<<<<<<<<<<<
 *         base = os.path.join(val, module, filename)
 *         if os.path.exists(base):
 */
  }
  __pyx_L18_break:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":249
 *             test = base;
 *             break
 *     if not test and optional:             # <<<<<<<<<<<<<<
 *         for val in pathlist:
 *             base = os.path.join(val, module, optional, filename)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
  __pyx_t_14 = ((!__pyx_t_1) != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_7 = __pyx_t_14;
    goto __pyx_L21_bool_binop_done;
  }
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_optional); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_14;
  __pyx_L21_bool_binop_done:;
  if (__pyx_t_7) {

    /* "metaphor/monal/util/toolbox.py":250
 *             break
 *     if not test and optional:
 *         for val in pathlist:             # <<<<<<<<<<<<<<
 *             base = os.path.join(val, module, optional, filename)
 *             if os.path.exists(base):
 */
    if (likely(PyList_CheckExact(__pyx_v_pathlist)) || PyTuple_CheckExact(__pyx_v_pathlist)) {
      __pyx_t_4 = __pyx_v_pathlist; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_pathlist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 250, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_12(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 250, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":251
 *     if not test and optional:
 *         for val in pathlist:
 *             base = os.path.join(val, module, optional, filename)             # <<<<<<<<<<<<<<
 *             if os.path.exists(base):
 *                 test = base;
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_val, __pyx_v_module, __pyx_v_optional, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_val, __pyx_v_module, __pyx_v_optional, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_v_val);
        __Pyx_INCREF(__pyx_v_module);
        __Pyx_GIVEREF(__pyx_v_module);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, __pyx_v_module);
        __Pyx_INCREF(__pyx_v_optional);
        __Pyx_GIVEREF(__pyx_v_optional);
        PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_5, __pyx_v_optional);
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_5, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":252
 *         for val in pathlist:
 *             base = os.path.join(val, module, optional, filename)
 *             if os.path.exists(base):             # <<<<<<<<<<<<<<
 *                 test = base;
 *                 break
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_13) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
          __Pyx_INCREF(__pyx_v_base);
          __Pyx_GIVEREF(__pyx_v_base);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_base);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {

        /* "metaphor/monal/util/toolbox.py":253
 *             base = os.path.join(val, module, optional, filename)
 *             if os.path.exists(base):
 *                 test = base;             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __Pyx_INCREF(__pyx_v_base);
        __Pyx_DECREF_SET(__pyx_v_test, __pyx_v_base);

        /* "metaphor/monal/util/toolbox.py":254
 *             if os.path.exists(base):
 *                 test = base;
 *                 break             # <<<<<<<<<<<<<<
 * 
 *     if not test:
 */
        goto __pyx_L24_break;

        /* "metaphor/monal/util/toolbox.py":252
 *         for val in pathlist:
 *             base = os.path.join(val, module, optional, filename)
 *             if os.path.exists(base):             # <<<<<<<<<<<<<<
 *                 test = base;
 *                 break
 */
      }

      /* "metaphor/monal/util/toolbox.py":250
 *             break
 *     if not test and optional:
 *         for val in pathlist:             # <<<<<<<<<<<<<<
 *             base = os.path.join(val, module, optional, filename)
 *             if os.path.exists(base):
 */
    }
    __pyx_L24_break:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":249
 *             test = base;
 *             break
 *     if not test and optional:             # <<<<<<<<<<<<<<
 *         for val in pathlist:
 *             base = os.path.join(val, module, optional, filename)
 */
  }

  /* "metaphor/monal/util/toolbox.py":256
 *                 break
 * 
 *     if not test:             # <<<<<<<<<<<<<<
 *         base = sys.exec_prefix
 *         if module:
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
  __pyx_t_14 = ((!__pyx_t_7) != 0);
  if (__pyx_t_14) {

    /* "metaphor/monal/util/toolbox.py":257
 * 
 *     if not test:
 *         base = sys.exec_prefix             # <<<<<<<<<<<<<<
 *         if module:
 *             base = os.path.join(base, module)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exec_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":258
 *     if not test:
 *         base = sys.exec_prefix
 *         if module:             # <<<<<<<<<<<<<<
 *             base = os.path.join(base, module)
 *             base = os.path.join(base, filename)
 */
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_module); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
    if (__pyx_t_14) {

      /* "metaphor/monal/util/toolbox.py":259
 *         base = sys.exec_prefix
 *         if module:
 *             base = os.path.join(base, module)             # <<<<<<<<<<<<<<
 *             base = os.path.join(base, filename)
 *             if os.path.exists(base):
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_base, __pyx_v_module};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_base, __pyx_v_module};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_v_base);
        __Pyx_GIVEREF(__pyx_v_base);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_base);
        __Pyx_INCREF(__pyx_v_module);
        __Pyx_GIVEREF(__pyx_v_module);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_module);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_base, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":260
 *         if module:
 *             base = os.path.join(base, module)
 *             base = os.path.join(base, filename)             # <<<<<<<<<<<<<<
 *             if os.path.exists(base):
 *                 test = base
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_base, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_base, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_base);
        __Pyx_GIVEREF(__pyx_v_base);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_base);
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_base, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":261
 *             base = os.path.join(base, module)
 *             base = os.path.join(base, filename)
 *             if os.path.exists(base):             # <<<<<<<<<<<<<<
 *                 test = base
 *         else:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(__pyx_v_base);
          __Pyx_GIVEREF(__pyx_v_base);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_base);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_14) {

        /* "metaphor/monal/util/toolbox.py":262
 *             base = os.path.join(base, filename)
 *             if os.path.exists(base):
 *                 test = base             # <<<<<<<<<<<<<<
 *         else:
 *             for root, dirs, _ in os.walk(base):  #files
 */
        __Pyx_INCREF(__pyx_v_base);
        __Pyx_DECREF_SET(__pyx_v_test, __pyx_v_base);

        /* "metaphor/monal/util/toolbox.py":261
 *             base = os.path.join(base, module)
 *             base = os.path.join(base, filename)
 *             if os.path.exists(base):             # <<<<<<<<<<<<<<
 *                 test = base
 *         else:
 */
      }

      /* "metaphor/monal/util/toolbox.py":258
 *     if not test:
 *         base = sys.exec_prefix
 *         if module:             # <<<<<<<<<<<<<<
 *             base = os.path.join(base, module)
 *             base = os.path.join(base, filename)
 */
      goto __pyx_L27;
    }

    /* "metaphor/monal/util/toolbox.py":264
 *                 test = base
 *         else:
 *             for root, dirs, _ in os.walk(base):  #files             # <<<<<<<<<<<<<<
 *                 if not test:
 *                     for mydir in dirs:
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_walk); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_base};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_base);
          __Pyx_GIVEREF(__pyx_v_base);
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_base);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_12(__pyx_t_6);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 264, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 264, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_13 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_13);
          #else
          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
          index = 0; __pyx_t_2 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_2)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          index = 1; __pyx_t_4 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_4)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          index = 2; __pyx_t_13 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_13)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 3) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
          __pyx_t_16 = NULL;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L32_unpacking_done;
          __pyx_L31_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 264, __pyx_L1_error)
          __pyx_L32_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_root, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_dirs, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/monal/util/toolbox.py":265
 *         else:
 *             for root, dirs, _ in os.walk(base):  #files
 *                 if not test:             # <<<<<<<<<<<<<<
 *                     for mydir in dirs:
 *                         mytest = os.path.join(root, mydir, filename)
 */
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
        __pyx_t_7 = ((!__pyx_t_14) != 0);
        if (__pyx_t_7) {

          /* "metaphor/monal/util/toolbox.py":266
 *             for root, dirs, _ in os.walk(base):  #files
 *                 if not test:
 *                     for mydir in dirs:             # <<<<<<<<<<<<<<
 *                         mytest = os.path.join(root, mydir, filename)
 *                         if os.path.exists(mytest):
 */
          if (likely(PyList_CheckExact(__pyx_v_dirs)) || PyTuple_CheckExact(__pyx_v_dirs)) {
            __pyx_t_3 = __pyx_v_dirs; __Pyx_INCREF(__pyx_t_3); __pyx_t_17 = 0;
            __pyx_t_18 = NULL;
          } else {
            __pyx_t_17 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dirs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_18 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 266, __pyx_L1_error)
          }
          for (;;) {
            if (likely(!__pyx_t_18)) {
              if (likely(PyList_CheckExact(__pyx_t_3))) {
                if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_17); __Pyx_INCREF(__pyx_t_13); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_3, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 266, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              } else {
                if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_17); __Pyx_INCREF(__pyx_t_13); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_3, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 266, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              }
            } else {
              __pyx_t_13 = __pyx_t_18(__pyx_t_3);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 266, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_13);
            }
            __Pyx_XDECREF_SET(__pyx_v_mydir, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "metaphor/monal/util/toolbox.py":267
 *                 if not test:
 *                     for mydir in dirs:
 *                         mytest = os.path.join(root, mydir, filename)             # <<<<<<<<<<<<<<
 *                         if os.path.exists(mytest):
 *                             test = mytest
 */
            __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = NULL;
            __pyx_t_5 = 0;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
                __pyx_t_5 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_root, __pyx_v_mydir, __pyx_v_filename};
              __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_GOTREF(__pyx_t_13);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_root, __pyx_v_mydir, __pyx_v_filename};
              __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_GOTREF(__pyx_t_13);
            } else
            #endif
            {
              __pyx_t_15 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_15);
              if (__pyx_t_2) {
                __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL;
              }
              __Pyx_INCREF(__pyx_v_root);
              __Pyx_GIVEREF(__pyx_v_root);
              PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_5, __pyx_v_root);
              __Pyx_INCREF(__pyx_v_mydir);
              __Pyx_GIVEREF(__pyx_v_mydir);
              PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_5, __pyx_v_mydir);
              __Pyx_INCREF(__pyx_v_filename);
              __Pyx_GIVEREF(__pyx_v_filename);
              PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_5, __pyx_v_filename);
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF_SET(__pyx_v_mytest, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "metaphor/monal/util/toolbox.py":268
 *                     for mydir in dirs:
 *                         mytest = os.path.join(root, mydir, filename)
 *                         if os.path.exists(mytest):             # <<<<<<<<<<<<<<
 *                             test = mytest
 *                             break
 */
            __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_15) {
              __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_mytest); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_13);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_mytest};
                __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_GOTREF(__pyx_t_13);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_mytest};
                __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_GOTREF(__pyx_t_13);
              } else
              #endif
              {
                __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_15); __pyx_t_15 = NULL;
                __Pyx_INCREF(__pyx_v_mytest);
                __Pyx_GIVEREF(__pyx_v_mytest);
                PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_mytest);
                __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (__pyx_t_7) {

              /* "metaphor/monal/util/toolbox.py":269
 *                         mytest = os.path.join(root, mydir, filename)
 *                         if os.path.exists(mytest):
 *                             test = mytest             # <<<<<<<<<<<<<<
 *                             break
 *     if not test:
 */
              __Pyx_INCREF(__pyx_v_mytest);
              __Pyx_DECREF_SET(__pyx_v_test, __pyx_v_mytest);

              /* "metaphor/monal/util/toolbox.py":270
 *                         if os.path.exists(mytest):
 *                             test = mytest
 *                             break             # <<<<<<<<<<<<<<
 *     if not test:
 *         for path in sys.path:
 */
              goto __pyx_L35_break;

              /* "metaphor/monal/util/toolbox.py":268
 *                     for mydir in dirs:
 *                         mytest = os.path.join(root, mydir, filename)
 *                         if os.path.exists(mytest):             # <<<<<<<<<<<<<<
 *                             test = mytest
 *                             break
 */
            }

            /* "metaphor/monal/util/toolbox.py":266
 *             for root, dirs, _ in os.walk(base):  #files
 *                 if not test:
 *                     for mydir in dirs:             # <<<<<<<<<<<<<<
 *                         mytest = os.path.join(root, mydir, filename)
 *                         if os.path.exists(mytest):
 */
          }
          __pyx_L35_break:;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "metaphor/monal/util/toolbox.py":265
 *         else:
 *             for root, dirs, _ in os.walk(base):  #files
 *                 if not test:             # <<<<<<<<<<<<<<
 *                     for mydir in dirs:
 *                         mytest = os.path.join(root, mydir, filename)
 */
        }

        /* "metaphor/monal/util/toolbox.py":264
 *                 test = base
 *         else:
 *             for root, dirs, _ in os.walk(base):  #files             # <<<<<<<<<<<<<<
 *                 if not test:
 *                     for mydir in dirs:
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L27:;

    /* "metaphor/monal/util/toolbox.py":256
 *                 break
 * 
 *     if not test:             # <<<<<<<<<<<<<<
 *         base = sys.exec_prefix
 *         if module:
 */
  }

  /* "metaphor/monal/util/toolbox.py":271
 *                             test = mytest
 *                             break
 *     if not test:             # <<<<<<<<<<<<<<
 *         for path in sys.path:
 *             mytest = os.path.join(path, filename)
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __pyx_t_14 = ((!__pyx_t_7) != 0);
  if (__pyx_t_14) {

    /* "metaphor/monal/util/toolbox.py":272
 *                             break
 *     if not test:
 *         for path in sys.path:             # <<<<<<<<<<<<<<
 *             mytest = os.path.join(path, filename)
 *             if os.path.exists(mytest):
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_12(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 272, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":273
 *     if not test:
 *         for path in sys.path:
 *             mytest = os.path.join(path, filename)             # <<<<<<<<<<<<<<
 *             if os.path.exists(mytest):
 *                 test = mytest
 */
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_13)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_path);
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mytest, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":274
 *         for path in sys.path:
 *             mytest = os.path.join(path, filename)
 *             if os.path.exists(mytest):             # <<<<<<<<<<<<<<
 *                 test = mytest
 *                 break
 */
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exists); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_mytest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_mytest};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_mytest};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(__pyx_v_mytest);
          __Pyx_GIVEREF(__pyx_v_mytest);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_mytest);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_14) {

        /* "metaphor/monal/util/toolbox.py":275
 *             mytest = os.path.join(path, filename)
 *             if os.path.exists(mytest):
 *                 test = mytest             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __Pyx_INCREF(__pyx_v_mytest);
        __Pyx_DECREF_SET(__pyx_v_test, __pyx_v_mytest);

        /* "metaphor/monal/util/toolbox.py":276
 *             if os.path.exists(mytest):
 *                 test = mytest
 *                 break             # <<<<<<<<<<<<<<
 * 
 *     if abspath and os.path.exists(test):
 */
        goto __pyx_L39_break;

        /* "metaphor/monal/util/toolbox.py":274
 *         for path in sys.path:
 *             mytest = os.path.join(path, filename)
 *             if os.path.exists(mytest):             # <<<<<<<<<<<<<<
 *                 test = mytest
 *                 break
 */
      }

      /* "metaphor/monal/util/toolbox.py":272
 *                             break
 *     if not test:
 *         for path in sys.path:             # <<<<<<<<<<<<<<
 *             mytest = os.path.join(path, filename)
 *             if os.path.exists(mytest):
 */
    }
    __pyx_L39_break:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/monal/util/toolbox.py":271
 *                             test = mytest
 *                             break
 *     if not test:             # <<<<<<<<<<<<<<
 *         for path in sys.path:
 *             mytest = os.path.join(path, filename)
 */
  }

  /* "metaphor/monal/util/toolbox.py":278
 *                 break
 * 
 *     if abspath and os.path.exists(test):             # <<<<<<<<<<<<<<
 *         return os.path.abspath(test)
 *     else:
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_abspath); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
  if (__pyx_t_7) {
  } else {
    __pyx_t_14 = __pyx_t_7;
    goto __pyx_L42_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_13) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_test); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_test};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_test};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); __pyx_t_13 = NULL;
      __Pyx_INCREF(__pyx_v_test);
      __Pyx_GIVEREF(__pyx_v_test);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_test);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_14 = __pyx_t_7;
  __pyx_L42_bool_binop_done:;
  if (__pyx_t_14) {

    /* "metaphor/monal/util/toolbox.py":279
 * 
 *     if abspath and os.path.exists(test):
 *         return os.path.abspath(test)             # <<<<<<<<<<<<<<
 *     else:
 *         return test
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_test); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_test};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_test};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_test);
        __Pyx_GIVEREF(__pyx_v_test);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_test);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":278
 *                 break
 * 
 *     if abspath and os.path.exists(test):             # <<<<<<<<<<<<<<
 *         return os.path.abspath(test)
 *     else:
 */
  }

  /* "metaphor/monal/util/toolbox.py":281
 *         return os.path.abspath(test)
 *     else:
 *         return test             # <<<<<<<<<<<<<<
 * 
 * def addpathlist(source, packagename, lst):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_test);
    __pyx_r = __pyx_v_test;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":223
 * #                 return st
 * 
 * def lookForFile(filename, package, module="", optional="", abspath=False, locationpath=""):             # <<<<<<<<<<<<<<
 *     """Recherche un fichier dans un package, et dans les enfants de ses ancetres
 *     portant le meme nom
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.lookForFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filename2);
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XDECREF(__pyx_v_pathlist);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XDECREF(__pyx_v_dirs);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_mydir);
  __Pyx_XDECREF(__pyx_v_mytest);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":283
 *         return test
 * 
 * def addpathlist(source, packagename, lst):             # <<<<<<<<<<<<<<
 *     if source:
 *         dirr, base = os.path.split(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15addpathlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_15addpathlist = {"addpathlist", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_15addpathlist, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15addpathlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_packagename = 0;
  PyObject *__pyx_v_lst = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addpathlist (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_packagename,&__pyx_n_s_lst,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_packagename)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("addpathlist", 1, 3, 3, 1); __PYX_ERR(0, 283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("addpathlist", 1, 3, 3, 2); __PYX_ERR(0, 283, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addpathlist") < 0)) __PYX_ERR(0, 283, __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_source = values[0];
    __pyx_v_packagename = values[1];
    __pyx_v_lst = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addpathlist", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 283, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.addpathlist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_14addpathlist(__pyx_self, __pyx_v_source, __pyx_v_packagename, __pyx_v_lst);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_14addpathlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_packagename, PyObject *__pyx_v_lst) {
  PyObject *__pyx_v_dirr = NULL;
  PyObject *__pyx_v_base = NULL;
  PyObject *__pyx_v_root = NULL;
  PyObject *__pyx_v_dirs = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("addpathlist", 0);
  __Pyx_INCREF(__pyx_v_lst);

  /* "metaphor/monal/util/toolbox.py":284
 * 
 * def addpathlist(source, packagename, lst):
 *     if source:             # <<<<<<<<<<<<<<
 *         dirr, base = os.path.split(source)
 *         if base == packagename:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_source); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":285
 * def addpathlist(source, packagename, lst):
 *     if source:
 *         dirr, base = os.path.split(source)             # <<<<<<<<<<<<<<
 *         if base == packagename:
 *             lst.append(source)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_source};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_source};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_source);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 285, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 285, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_dirr = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_base = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "metaphor/monal/util/toolbox.py":286
 *     if source:
 *         dirr, base = os.path.split(source)
 *         if base == packagename:             # <<<<<<<<<<<<<<
 *             lst.append(source)
 *         else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_base, __pyx_v_packagename, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":287
 *         dirr, base = os.path.split(source)
 *         if base == packagename:
 *             lst.append(source)             # <<<<<<<<<<<<<<
 *         else:
 *             root, dirs, _ = next(os.walk(dirr))  #files
 */
      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_v_source); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 287, __pyx_L1_error)

      /* "metaphor/monal/util/toolbox.py":286
 *     if source:
 *         dirr, base = os.path.split(source)
 *         if base == packagename:             # <<<<<<<<<<<<<<
 *             lst.append(source)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "metaphor/monal/util/toolbox.py":289
 *             lst.append(source)
 *         else:
 *             root, dirs, _ = next(os.walk(dirr))  #files             # <<<<<<<<<<<<<<
 *             if packagename in dirs:
 *                 lst.append(os.path.join(root, packagename))
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_walk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dirr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dirr};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dirr};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_dirr);
          __Pyx_GIVEREF(__pyx_v_dirr);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_dirr);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 289, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_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_ERR(0, 289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_8), 3) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 289, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __pyx_v_root = __pyx_t_2;
      __pyx_t_2 = 0;
      __pyx_v_dirs = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v__ = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "metaphor/monal/util/toolbox.py":290
 *         else:
 *             root, dirs, _ = next(os.walk(dirr))  #files
 *             if packagename in dirs:             # <<<<<<<<<<<<<<
 *                 lst.append(os.path.join(root, packagename))
 *         if base:
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_packagename, __pyx_v_dirs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_1 != 0);
      if (__pyx_t_9) {

        /* "metaphor/monal/util/toolbox.py":291
 *             root, dirs, _ = next(os.walk(dirr))  #files
 *             if packagename in dirs:
 *                 lst.append(os.path.join(root, packagename))             # <<<<<<<<<<<<<<
 *         if base:
 *             lst = addpathlist(dirr, packagename, lst)
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_root, __pyx_v_packagename};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_root, __pyx_v_packagename};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_root);
          __Pyx_GIVEREF(__pyx_v_root);
          PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_10, __pyx_v_root);
          __Pyx_INCREF(__pyx_v_packagename);
          __Pyx_GIVEREF(__pyx_v_packagename);
          PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_10, __pyx_v_packagename);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "metaphor/monal/util/toolbox.py":290
 *         else:
 *             root, dirs, _ = next(os.walk(dirr))  #files
 *             if packagename in dirs:             # <<<<<<<<<<<<<<
 *                 lst.append(os.path.join(root, packagename))
 *         if base:
 */
      }
    }
    __pyx_L6:;

    /* "metaphor/monal/util/toolbox.py":292
 *             if packagename in dirs:
 *                 lst.append(os.path.join(root, packagename))
 *         if base:             # <<<<<<<<<<<<<<
 *             lst = addpathlist(dirr, packagename, lst)
 *     return lst
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_base); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "metaphor/monal/util/toolbox.py":293
 *                 lst.append(os.path.join(root, packagename))
 *         if base:
 *             lst = addpathlist(dirr, packagename, lst)             # <<<<<<<<<<<<<<
 *     return lst
 * 
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_addpathlist); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(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);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_dirr, __pyx_v_packagename, __pyx_v_lst};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_dirr, __pyx_v_packagename, __pyx_v_lst};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_v_dirr);
        __Pyx_GIVEREF(__pyx_v_dirr);
        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_dirr);
        __Pyx_INCREF(__pyx_v_packagename);
        __Pyx_GIVEREF(__pyx_v_packagename);
        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_v_packagename);
        __Pyx_INCREF(__pyx_v_lst);
        __Pyx_GIVEREF(__pyx_v_lst);
        PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_10, __pyx_v_lst);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":292
 *             if packagename in dirs:
 *                 lst.append(os.path.join(root, packagename))
 *         if base:             # <<<<<<<<<<<<<<
 *             lst = addpathlist(dirr, packagename, lst)
 *     return lst
 */
    }

    /* "metaphor/monal/util/toolbox.py":284
 * 
 * def addpathlist(source, packagename, lst):
 *     if source:             # <<<<<<<<<<<<<<
 *         dirr, base = os.path.split(source)
 *         if base == packagename:
 */
  }

  /* "metaphor/monal/util/toolbox.py":294
 *         if base:
 *             lst = addpathlist(dirr, packagename, lst)
 *     return lst             # <<<<<<<<<<<<<<
 * 
 * def getconfigfile(filesource, candidate, modname=""):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_lst);
  __pyx_r = __pyx_v_lst;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":283
 *         return test
 * 
 * def addpathlist(source, packagename, lst):             # <<<<<<<<<<<<<<
 *     if source:
 *         dirr, base = os.path.split(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.addpathlist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dirr);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XDECREF(__pyx_v_dirs);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":296
 *     return lst
 * 
 * def getconfigfile(filesource, candidate, modname=""):             # <<<<<<<<<<<<<<
 *     configfile = ""
 *     for val in sys.argv:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_17getconfigfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_17getconfigfile = {"getconfigfile", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_17getconfigfile, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_17getconfigfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filesource = 0;
  PyObject *__pyx_v_candidate = 0;
  PyObject *__pyx_v_modname = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getconfigfile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filesource,&__pyx_n_s_candidate,&__pyx_n_s_modname,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filesource)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_candidate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getconfigfile", 0, 2, 3, 1); __PYX_ERR(0, 296, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_modname);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getconfigfile") < 0)) __PYX_ERR(0, 296, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filesource = values[0];
    __pyx_v_candidate = values[1];
    __pyx_v_modname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getconfigfile", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 296, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getconfigfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_16getconfigfile(__pyx_self, __pyx_v_filesource, __pyx_v_candidate, __pyx_v_modname);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_16getconfigfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filesource, PyObject *__pyx_v_candidate, PyObject *__pyx_v_modname) {
  PyObject *__pyx_v_configfile = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("getconfigfile", 0);

  /* "metaphor/monal/util/toolbox.py":297
 * 
 * def getconfigfile(filesource, candidate, modname=""):
 *     configfile = ""             # <<<<<<<<<<<<<<
 *     for val in sys.argv:
 *         if val.startswith("-c"):
 */
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_v_configfile = __pyx_kp_u__17;

  /* "metaphor/monal/util/toolbox.py":298
 * def getconfigfile(filesource, candidate, modname=""):
 *     configfile = ""
 *     for val in sys.argv:             # <<<<<<<<<<<<<<
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 298, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":299
 *     configfile = ""
 *     for val in sys.argv:
 *         if val.startswith("-c"):             # <<<<<<<<<<<<<<
 *             configfile = unquote(val[2:])
 *     if not configfile:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "metaphor/monal/util/toolbox.py":300
 *     for val in sys.argv:
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])             # <<<<<<<<<<<<<<
 *     if not configfile:
 *         configfile = lookForFile(candidate, None, modname)
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_val, 2, 0, NULL, NULL, &__pyx_slice__19, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_configfile, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/monal/util/toolbox.py":299
 *     configfile = ""
 *     for val in sys.argv:
 *         if val.startswith("-c"):             # <<<<<<<<<<<<<<
 *             configfile = unquote(val[2:])
 *     if not configfile:
 */
    }

    /* "metaphor/monal/util/toolbox.py":298
 * def getconfigfile(filesource, candidate, modname=""):
 *     configfile = ""
 *     for val in sys.argv:             # <<<<<<<<<<<<<<
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":301
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])
 *     if not configfile:             # <<<<<<<<<<<<<<
 *         configfile = lookForFile(candidate, None, modname)
 *     if not configfile or not os.path.exists(configfile):
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_configfile); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 301, __pyx_L1_error)
  __pyx_t_10 = ((!__pyx_t_6) != 0);
  if (__pyx_t_10) {

    /* "metaphor/monal/util/toolbox.py":302
 *             configfile = unquote(val[2:])
 *     if not configfile:
 *         configfile = lookForFile(candidate, None, modname)             # <<<<<<<<<<<<<<
 *     if not configfile or not os.path.exists(configfile):
 *         configfile = os.path.join(os.path.dirname(filesource), candidate)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookForFile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_candidate, Py_None, __pyx_v_modname};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_candidate, Py_None, __pyx_v_modname};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_candidate);
      __Pyx_GIVEREF(__pyx_v_candidate);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_v_candidate);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, Py_None);
      __Pyx_INCREF(__pyx_v_modname);
      __Pyx_GIVEREF(__pyx_v_modname);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_11, __pyx_v_modname);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_configfile, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":301
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])
 *     if not configfile:             # <<<<<<<<<<<<<<
 *         configfile = lookForFile(candidate, None, modname)
 *     if not configfile or not os.path.exists(configfile):
 */
  }

  /* "metaphor/monal/util/toolbox.py":303
 *     if not configfile:
 *         configfile = lookForFile(candidate, None, modname)
 *     if not configfile or not os.path.exists(configfile):             # <<<<<<<<<<<<<<
 *         configfile = os.path.join(os.path.dirname(filesource), candidate)
 *     return configfile
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_configfile); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_t_12 = ((!__pyx_t_6) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_10 = __pyx_t_12;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_configfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_configfile};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_configfile};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_configfile);
      __Pyx_GIVEREF(__pyx_v_configfile);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_configfile);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!__pyx_t_12) != 0);
  __pyx_t_10 = __pyx_t_6;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_10) {

    /* "metaphor/monal/util/toolbox.py":304
 *         configfile = lookForFile(candidate, None, modname)
 *     if not configfile or not os.path.exists(configfile):
 *         configfile = os.path.join(os.path.dirname(filesource), candidate)             # <<<<<<<<<<<<<<
 *     return configfile
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_filesource); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filesource};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filesource};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_filesource);
        __Pyx_GIVEREF(__pyx_v_filesource);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filesource);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_2, __pyx_v_candidate};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_2, __pyx_v_candidate};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_t_2);
      __Pyx_INCREF(__pyx_v_candidate);
      __Pyx_GIVEREF(__pyx_v_candidate);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_v_candidate);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_configfile, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":303
 *     if not configfile:
 *         configfile = lookForFile(candidate, None, modname)
 *     if not configfile or not os.path.exists(configfile):             # <<<<<<<<<<<<<<
 *         configfile = os.path.join(os.path.dirname(filesource), candidate)
 *     return configfile
 */
  }

  /* "metaphor/monal/util/toolbox.py":305
 *     if not configfile or not os.path.exists(configfile):
 *         configfile = os.path.join(os.path.dirname(filesource), candidate)
 *     return configfile             # <<<<<<<<<<<<<<
 * 
 * def getOptions(configfile, section):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_configfile);
  __pyx_r = __pyx_v_configfile;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":296
 *     return lst
 * 
 * def getconfigfile(filesource, candidate, modname=""):             # <<<<<<<<<<<<<<
 *     configfile = ""
 *     for val in sys.argv:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getconfigfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_configfile);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":307
 *     return configfile
 * 
 * def getOptions(configfile, section):             # <<<<<<<<<<<<<<
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_19getOptions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_19getOptions = {"getOptions", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_19getOptions, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_19getOptions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_configfile = 0;
  PyObject *__pyx_v_section = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getOptions (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_configfile,&__pyx_n_s_section,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_configfile)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_section)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getOptions", 1, 2, 2, 1); __PYX_ERR(0, 307, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOptions") < 0)) __PYX_ERR(0, 307, __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_configfile = values[0];
    __pyx_v_section = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getOptions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_18getOptions(__pyx_self, __pyx_v_configfile, __pyx_v_section);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_18getOptions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_configfile, PyObject *__pyx_v_section) {
  PyObject *__pyx_v_defconf = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannySetupContext("getOptions", 0);

  /* "metaphor/monal/util/toolbox.py":308
 * 
 * def getOptions(configfile, section):
 *     defconf = defaultedConfigParser(configfile)             # <<<<<<<<<<<<<<
 *     res = {}
 *     if defconf.has_section(section):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultedConfigParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_configfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_configfile};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_configfile};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_configfile);
      __Pyx_GIVEREF(__pyx_v_configfile);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_configfile);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_defconf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":309
 * def getOptions(configfile, section):
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}             # <<<<<<<<<<<<<<
 *     if defconf.has_section(section):
 *         for key, value in defconf.items(section):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":310
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 *     if defconf.has_section(section):             # <<<<<<<<<<<<<<
 *         for key, value in defconf.items(section):
 *             res[key] = value
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_defconf, __pyx_n_s_has_section); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_section); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_section};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_section};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_section);
      __Pyx_GIVEREF(__pyx_v_section);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_section);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "metaphor/monal/util/toolbox.py":311
 *     res = {}
 *     if defconf.has_section(section):
 *         for key, value in defconf.items(section):             # <<<<<<<<<<<<<<
 *             res[key] = value
 *     del defconf
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_defconf, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_section); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_section};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_section};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_section);
        __Pyx_GIVEREF(__pyx_v_section);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_section);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 311, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 311, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 311, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":312
 *     if defconf.has_section(section):
 *         for key, value in defconf.items(section):
 *             res[key] = value             # <<<<<<<<<<<<<<
 *     del defconf
 *     return res
 */
      if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(0, 312, __pyx_L1_error)

      /* "metaphor/monal/util/toolbox.py":311
 *     res = {}
 *     if defconf.has_section(section):
 *         for key, value in defconf.items(section):             # <<<<<<<<<<<<<<
 *             res[key] = value
 *     del defconf
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":310
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 *     if defconf.has_section(section):             # <<<<<<<<<<<<<<
 *         for key, value in defconf.items(section):
 *             res[key] = value
 */
  }

  /* "metaphor/monal/util/toolbox.py":313
 *         for key, value in defconf.items(section):
 *             res[key] = value
 *     del defconf             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
  __Pyx_DECREF(__pyx_v_defconf);
  __pyx_v_defconf = NULL;

  /* "metaphor/monal/util/toolbox.py":314
 *             res[key] = value
 *     del defconf
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # def subprocess_call(*args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":307
 *     return configfile
 * 
 * def getOptions(configfile, section):             # <<<<<<<<<<<<<<
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 */

  /* function 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_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_defconf);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":331
 * #     return retcode
 * 
 * def getexecparam(*args, **kwarg):             # <<<<<<<<<<<<<<
 *     """lance un executable, et retourne les premires lignes de la rponse
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_21getexecparam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_20getexecparam[] = "lance un executable, et retourne les premi\303\203\302\203\303\202\305\241res lignes de la r\303\203\302\203\303\202\302\251ponse\n    ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_21getexecparam = {"getexecparam", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_21getexecparam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_20getexecparam};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_21getexecparam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwarg = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getexecparam (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getexecparam", 1))) return NULL;
  __pyx_v_kwarg = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwarg)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwarg);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_20getexecparam(__pyx_self, __pyx_v_args, __pyx_v_kwarg);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_20getexecparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwarg) {
  PyObject *__pyx_v_subprocess = NULL;
  PyObject *__pyx_v_sst = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_v_st2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("getexecparam", 0);

  /* "metaphor/monal/util/toolbox.py":334
 *     """lance un executable, et retourne les premires lignes de la rponse
 *     """
 *     import subprocess             # <<<<<<<<<<<<<<
 *     if (len(args) == 1) and not kwarg:
 *         sst = args[0]
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_subprocess = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":335
 *     """
 *     import subprocess
 *     if (len(args) == 1) and not kwarg:             # <<<<<<<<<<<<<<
 *         sst = args[0]
 *     else:
 */
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 335, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 == 1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwarg); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 335, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":336
 *     import subprocess
 *     if (len(args) == 1) and not kwarg:
 *         sst = args[0]             # <<<<<<<<<<<<<<
 *     else:
 *         if kwarg:
 */
    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_sst = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":335
 *     """
 *     import subprocess
 *     if (len(args) == 1) and not kwarg:             # <<<<<<<<<<<<<<
 *         sst = args[0]
 *     else:
 */
    goto __pyx_L3;
  }

  /* "metaphor/monal/util/toolbox.py":338
 *         sst = args[0]
 *     else:
 *         if kwarg:             # <<<<<<<<<<<<<<
 *             l = kwarg["lines"]
 *         else:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwarg); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "metaphor/monal/util/toolbox.py":339
 *     else:
 *         if kwarg:
 *             l = kwarg["lines"]             # <<<<<<<<<<<<<<
 *         else:
 *             l = 1
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kwarg, __pyx_n_u_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_l = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":338
 *         sst = args[0]
 *     else:
 *         if kwarg:             # <<<<<<<<<<<<<<
 *             l = kwarg["lines"]
 *         else:
 */
      goto __pyx_L6;
    }

    /* "metaphor/monal/util/toolbox.py":341
 *             l = kwarg["lines"]
 *         else:
 *             l = 1             # <<<<<<<<<<<<<<
 *         sst = list(args)
 *     st = subprocess.Popen(sst, stdout=subprocess.PIPE).communicate()[0]
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_v_l = __pyx_int_1;
    }
    __pyx_L6:;

    /* "metaphor/monal/util/toolbox.py":342
 *         else:
 *             l = 1
 *         sst = list(args)             # <<<<<<<<<<<<<<
 *     st = subprocess.Popen(sst, stdout=subprocess.PIPE).communicate()[0]
 *     st2 = "\n".join(st.splitlines()[:l])
 */
    __pyx_t_1 = PySequence_List(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_sst = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "metaphor/monal/util/toolbox.py":343
 *             l = 1
 *         sst = list(args)
 *     st = subprocess.Popen(sst, stdout=subprocess.PIPE).communicate()[0]             # <<<<<<<<<<<<<<
 *     st2 = "\n".join(st.splitlines()[:l])
 *     return st2
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_subprocess, __pyx_n_s_Popen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_sst);
  __Pyx_GIVEREF(__pyx_v_sst);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_sst);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_subprocess, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_stdout, __pyx_t_9) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_communicate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_st = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "metaphor/monal/util/toolbox.py":344
 *         sst = list(args)
 *     st = subprocess.Popen(sst, stdout=subprocess.PIPE).communicate()[0]
 *     st2 = "\n".join(st.splitlines()[:l])             # <<<<<<<<<<<<<<
 *     return st2
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_splitlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_9) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_v_l)) { __Pyx_RaiseUnboundLocalError("l"); __PYX_ERR(0, 344, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, &__pyx_v_l, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__20, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_st2 = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/monal/util/toolbox.py":345
 *     st = subprocess.Popen(sst, stdout=subprocess.PIPE).communicate()[0]
 *     st2 = "\n".join(st.splitlines()[:l])
 *     return st2             # <<<<<<<<<<<<<<
 * 
 * #import platform
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_st2);
  __pyx_r = __pyx_v_st2;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":331
 * #     return retcode
 * 
 * def getexecparam(*args, **kwarg):             # <<<<<<<<<<<<<<
 *     """lance un executable, et retourne les premires lignes de la rponse
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getexecparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_subprocess);
  __Pyx_XDECREF(__pyx_v_sst);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_st2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":368
 * 
 * class textwriter(object):
 *     def __init__(self, target):             # <<<<<<<<<<<<<<
 *         super(textwriter, self).__init__()
 *         self.target = target
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_target,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 368, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 368, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_target = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 368, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter___init__(__pyx_self, __pyx_v_self, __pyx_v_target);

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

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

  /* "metaphor/monal/util/toolbox.py":369
 * class textwriter(object):
 *     def __init__(self, target):
 *         super(textwriter, self).__init__()             # <<<<<<<<<<<<<<
 *         self.target = target
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_textwriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":370
 *     def __init__(self, target):
 *         super(textwriter, self).__init__()
 *         self.target = target             # <<<<<<<<<<<<<<
 * 
 *     def writeImage(self, *args, **kwds):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_target, __pyx_v_target) < 0) __PYX_ERR(0, 370, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":368
 * 
 * class textwriter(object):
 *     def __init__(self, target):             # <<<<<<<<<<<<<<
 *         super(textwriter, self).__init__()
 *         self.target = target
 */

  /* 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("metaphor.monal.util.toolbox.textwriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":372
 *         self.target = target
 * 
 *     def writeImage(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_3writeImage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_3writeImage = {"writeImage", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_3writeImage, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_3writeImage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writeImage (wrapper)", 0);
  __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, used_pos_args, "writeImage") < 0)) __PYX_ERR(0, 372, __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_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("writeImage", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 372, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.writeImage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_2writeImage(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwds);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_2writeImage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  __Pyx_RefNannySetupContext("writeImage", 0);

  /* "metaphor/monal/util/toolbox.py":373
 * 
 *     def writeImage(self, *args, **kwds):
 *         try:             # <<<<<<<<<<<<<<
 *             self.target.WriteImage(*args, **kwds)
 *         except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":374
 *     def writeImage(self, *args, **kwds):
 *         try:
 *             self.target.WriteImage(*args, **kwds)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             #self.target.WriteText(err)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_WriteImage); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_v_args, __pyx_v_kwds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":373
 * 
 *     def writeImage(self, *args, **kwds):
 *         try:             # <<<<<<<<<<<<<<
 *             self.target.WriteImage(*args, **kwds)
 *         except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":375
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             #self.target.WriteText(err)
 *             print (err)
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.writeImage", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 375, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":377
 *         except Exception as err:
 *             #self.target.WriteText(err)
 *             print (err)             # <<<<<<<<<<<<<<
 * 
 *     def write(self, *args, **kwds):
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_err); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "metaphor/monal/util/toolbox.py":375
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             #self.target.WriteText(err)
 *             print (err)
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L15;
        }
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __pyx_t_6 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          }
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
          __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":373
 * 
 *     def writeImage(self, *args, **kwds):
 *         try:             # <<<<<<<<<<<<<<
 *             self.target.WriteImage(*args, **kwds)
 *         except Exception as err:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":372
 *         self.target = target
 * 
 *     def writeImage(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.writeImage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":379
 *             print (err)
 * 
 *     def write(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         test = "color" in kwds
 *         if test:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_5write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_5write = {"write", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_5write, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_5write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, used_pos_args, "write") < 0)) __PYX_ERR(0, 379, __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_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 379, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_4write(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwds);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_4write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_test = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_textAttr = NULL;
  PyObject *__pyx_v_colmem = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("write", 0);

  /* "metaphor/monal/util/toolbox.py":380
 * 
 *     def write(self, *args, **kwds):
 *         test = "color" in kwds             # <<<<<<<<<<<<<<
 *         if test:
 *             color = kwds.pop("color")
 */
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_color, __pyx_v_kwds, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_test = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":381
 *     def write(self, *args, **kwds):
 *         test = "color" in kwds
 *         if test:             # <<<<<<<<<<<<<<
 *             color = kwds.pop("color")
 *             try:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":382
 *         test = "color" in kwds
 *         if test:
 *             color = kwds.pop("color")             # <<<<<<<<<<<<<<
 *             try:
 *                 textAttr = self.target.GetDefaultStyle()
 */
    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_kwds, __pyx_n_u_color, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_color = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":383
 *         if test:
 *             color = kwds.pop("color")
 *             try:             # <<<<<<<<<<<<<<
 *                 textAttr = self.target.GetDefaultStyle()
 *                 if textAttr.TextColour.IsOk():
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":384
 *             color = kwds.pop("color")
 *             try:
 *                 textAttr = self.target.GetDefaultStyle()             # <<<<<<<<<<<<<<
 *                 if textAttr.TextColour.IsOk():
 *                     colmem = textAttr.TextColour.GetAsString()
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_GetDefaultStyle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L4_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L4_error)
        }
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_textAttr = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "metaphor/monal/util/toolbox.py":385
 *             try:
 *                 textAttr = self.target.GetDefaultStyle()
 *                 if textAttr.TextColour.IsOk():             # <<<<<<<<<<<<<<
 *                     colmem = textAttr.TextColour.GetAsString()
 *                 else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_textAttr, __pyx_n_s_TextColour); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_IsOk); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && 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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L4_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L4_error)
        }
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 385, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_1) {

          /* "metaphor/monal/util/toolbox.py":386
 *                 textAttr = self.target.GetDefaultStyle()
 *                 if textAttr.TextColour.IsOk():
 *                     colmem = textAttr.TextColour.GetAsString()             # <<<<<<<<<<<<<<
 *                 else:
 *                     colmem = 'black'
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_textAttr, __pyx_n_s_TextColour); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_GetAsString); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          if (__pyx_t_6) {
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L4_error)
          }
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_v_colmem = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "metaphor/monal/util/toolbox.py":385
 *             try:
 *                 textAttr = self.target.GetDefaultStyle()
 *                 if textAttr.TextColour.IsOk():             # <<<<<<<<<<<<<<
 *                     colmem = textAttr.TextColour.GetAsString()
 *                 else:
 */
          goto __pyx_L10;
        }

        /* "metaphor/monal/util/toolbox.py":388
 *                     colmem = textAttr.TextColour.GetAsString()
 *                 else:
 *                     colmem = 'black'             # <<<<<<<<<<<<<<
 *                 textAttr.SetTextColour(color)
 *                 self.target.SetDefaultStyle(textAttr)
 */
        /*else*/ {
          __Pyx_INCREF(__pyx_n_u_black);
          __pyx_v_colmem = __pyx_n_u_black;
        }
        __pyx_L10:;

        /* "metaphor/monal/util/toolbox.py":389
 *                 else:
 *                     colmem = 'black'
 *                 textAttr.SetTextColour(color)             # <<<<<<<<<<<<<<
 *                 self.target.SetDefaultStyle(textAttr)
 *             except:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_textAttr, __pyx_n_s_SetTextColour); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_color};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L4_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_color};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L4_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_INCREF(__pyx_v_color);
            __Pyx_GIVEREF(__pyx_v_color);
            PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_color);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/monal/util/toolbox.py":390
 *                     colmem = 'black'
 *                 textAttr.SetTextColour(color)
 *                 self.target.SetDefaultStyle(textAttr)             # <<<<<<<<<<<<<<
 *             except:
 *                 pass
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 390, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_SetDefaultStyle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_textAttr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_textAttr};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L4_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_textAttr};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L4_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_textAttr);
            __Pyx_GIVEREF(__pyx_v_textAttr);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_textAttr);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/monal/util/toolbox.py":383
 *         if test:
 *             color = kwds.pop("color")
 *             try:             # <<<<<<<<<<<<<<
 *                 textAttr = self.target.GetDefaultStyle()
 *                 if textAttr.TextColour.IsOk():
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/monal/util/toolbox.py":391
 *                 textAttr.SetTextColour(color)
 *                 self.target.SetDefaultStyle(textAttr)
 *             except:             # <<<<<<<<<<<<<<
 *                 pass
 *         try:
 */
      /*except:*/ {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L5_exception_handled;
      }
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "metaphor/monal/util/toolbox.py":381
 *     def write(self, *args, **kwds):
 *         test = "color" in kwds
 *         if test:             # <<<<<<<<<<<<<<
 *             color = kwds.pop("color")
 *             try:
 */
  }

  /* "metaphor/monal/util/toolbox.py":393
 *             except:
 *                 pass
 *         try:             # <<<<<<<<<<<<<<
 *             res = self.target.write(*args, **kwds)
 *         except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":394
 *                 pass
 *         try:
 *             res = self.target.write(*args, **kwds)             # <<<<<<<<<<<<<<
 *         except:
 *             res = self.target.WriteText(*args, **kwds)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_args, __pyx_v_kwds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_res = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "metaphor/monal/util/toolbox.py":393
 *             except:
 *                 pass
 *         try:             # <<<<<<<<<<<<<<
 *             res = self.target.write(*args, **kwds)
 *         except:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L16_try_end;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":395
 *         try:
 *             res = self.target.write(*args, **kwds)
 *         except:             # <<<<<<<<<<<<<<
 *             res = self.target.WriteText(*args, **kwds)
 *             try:
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 395, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_6);

      /* "metaphor/monal/util/toolbox.py":396
 *             res = self.target.write(*args, **kwds)
 *         except:
 *             res = self.target.WriteText(*args, **kwds)             # <<<<<<<<<<<<<<
 *             try:
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_WriteText); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 396, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_v_args, __pyx_v_kwds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/monal/util/toolbox.py":397
 *         except:
 *             res = self.target.WriteText(*args, **kwds)
 *             try:             # <<<<<<<<<<<<<<
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 *             except: pass
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "metaphor/monal/util/toolbox.py":398
 *             res = self.target.WriteText(*args, **kwds)
 *             try:
 *                 self.target.ShowPosition(self.target.InsertionPoint)             # <<<<<<<<<<<<<<
 *             except: pass
 *         if test:
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ShowPosition); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 398, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InsertionPoint); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 398, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
            }
          }
          if (!__pyx_t_9) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_13)) {
              PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_14};
              __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L19_error)
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
              PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_14};
              __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L19_error)
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            {
              __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 398, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_15);
              __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); __pyx_t_9 = NULL;
              __Pyx_GIVEREF(__pyx_t_14);
              PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_14);
              __pyx_t_14 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "metaphor/monal/util/toolbox.py":397
 *         except:
 *             res = self.target.WriteText(*args, **kwds)
 *             try:             # <<<<<<<<<<<<<<
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 *             except: pass
 */
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L26_try_end;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":399
 *             try:
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 *             except: pass             # <<<<<<<<<<<<<<
 *         if test:
 *             try:
 */
        /*except:*/ {
          __Pyx_ErrRestore(0,0,0);
          goto __pyx_L20_exception_handled;
        }
        __pyx_L20_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L26_try_end:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12_exception_handled;
    }
    __pyx_L13_except_error:;

    /* "metaphor/monal/util/toolbox.py":393
 *             except:
 *                 pass
 *         try:             # <<<<<<<<<<<<<<
 *             res = self.target.write(*args, **kwds)
 *         except:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L12_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    __pyx_L16_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":400
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 *             except: pass
 *         if test:             # <<<<<<<<<<<<<<
 *             try:
 *                 textAttr.TextColour = colmem
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":401
 *             except: pass
 *         if test:
 *             try:             # <<<<<<<<<<<<<<
 *                 textAttr.TextColour = colmem
 *                 self.target.SetDefaultStyle(textAttr)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":402
 *         if test:
 *             try:
 *                 textAttr.TextColour = colmem             # <<<<<<<<<<<<<<
 *                 self.target.SetDefaultStyle(textAttr)
 *             except:
 */
        if (unlikely(!__pyx_v_colmem)) { __Pyx_RaiseUnboundLocalError("colmem"); __PYX_ERR(0, 402, __pyx_L28_error) }
        if (unlikely(!__pyx_v_textAttr)) { __Pyx_RaiseUnboundLocalError("textAttr"); __PYX_ERR(0, 402, __pyx_L28_error) }
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_textAttr, __pyx_n_s_TextColour, __pyx_v_colmem) < 0) __PYX_ERR(0, 402, __pyx_L28_error)

        /* "metaphor/monal/util/toolbox.py":403
 *             try:
 *                 textAttr.TextColour = colmem
 *                 self.target.SetDefaultStyle(textAttr)             # <<<<<<<<<<<<<<
 *             except:
 *                 pass
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 403, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_SetDefaultStyle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_v_textAttr)) { __Pyx_RaiseUnboundLocalError("textAttr"); __PYX_ERR(0, 403, __pyx_L28_error) }
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_textAttr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L28_error)
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_textAttr};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L28_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_textAttr};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L28_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          {
            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_INCREF(__pyx_v_textAttr);
            __Pyx_GIVEREF(__pyx_v_textAttr);
            PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_textAttr);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "metaphor/monal/util/toolbox.py":401
 *             except: pass
 *         if test:
 *             try:             # <<<<<<<<<<<<<<
 *                 textAttr.TextColour = colmem
 *                 self.target.SetDefaultStyle(textAttr)
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L33_try_end;
      __pyx_L28_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/monal/util/toolbox.py":404
 *                 textAttr.TextColour = colmem
 *                 self.target.SetDefaultStyle(textAttr)
 *             except:             # <<<<<<<<<<<<<<
 *                 pass
 *         return res
 */
      /*except:*/ {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L29_exception_handled;
      }
      __pyx_L29_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L33_try_end:;
    }

    /* "metaphor/monal/util/toolbox.py":400
 *                 self.target.ShowPosition(self.target.InsertionPoint)
 *             except: pass
 *         if test:             # <<<<<<<<<<<<<<
 *             try:
 *                 textAttr.TextColour = colmem
 */
  }

  /* "metaphor/monal/util/toolbox.py":406
 *             except:
 *                 pass
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":379
 *             print (err)
 * 
 *     def write(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         test = "color" in kwds
 *         if test:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.textwriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_textAttr);
  __Pyx_XDECREF(__pyx_v_colmem);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":408
 *         return res
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_7flush(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_7flush = {"flush", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_7flush, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10textwriter_7flush(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_10textwriter_6flush(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

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

/* "metaphor/monal/util/toolbox.py":411
 *         pass
 * 
 * def run_script(script_name, script_args=None):             # <<<<<<<<<<<<<<
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_23run_script(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_23run_script = {"run_script", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_23run_script, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_23run_script(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_script_name = 0;
  PyObject *__pyx_v_script_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("run_script (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_script_name,&__pyx_n_s_script_args,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_script_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_script_args);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_script") < 0)) __PYX_ERR(0, 411, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_script_name = values[0];
    __pyx_v_script_args = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("run_script", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 411, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.run_script", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_22run_script(__pyx_self, __pyx_v_script_name, __pyx_v_script_args);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_22run_script(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_script_name, PyObject *__pyx_v_script_args) {
  PyObject *__pyx_v_save_argv = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("run_script", 0);

  /* "metaphor/monal/util/toolbox.py":412
 * 
 * def run_script(script_name, script_args=None):
 *     save_argv = sys.argv[:]             # <<<<<<<<<<<<<<
 *     g = {'__file__': script_name}
 *     l = {}
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__21, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_save_argv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":413
 * def run_script(script_name, script_args=None):
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}             # <<<<<<<<<<<<<<
 *     l = {}
 *     try:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_file, __pyx_v_script_name) < 0) __PYX_ERR(0, 413, __pyx_L1_error)
  __pyx_v_g = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":414
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}
 *     l = {}             # <<<<<<<<<<<<<<
 *     try:
 *         try:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":415
 *     g = {'__file__': script_name}
 *     l = {}
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             sys.argv[0] = script_name
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":416
 *     l = {}
 *     try:
 *         try:             # <<<<<<<<<<<<<<
 *             sys.argv[0] = script_name
 *             if script_args is not None:
 */
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":417
 *     try:
 *         try:
 *             sys.argv[0] = script_name             # <<<<<<<<<<<<<<
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 0, __pyx_v_script_name, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 417, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/monal/util/toolbox.py":418
 *         try:
 *             sys.argv[0] = script_name
 *             if script_args is not None:             # <<<<<<<<<<<<<<
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:
 */
        __pyx_t_6 = (__pyx_v_script_args != Py_None);
        __pyx_t_7 = (__pyx_t_6 != 0);
        if (__pyx_t_7) {

          /* "metaphor/monal/util/toolbox.py":419
 *             sys.argv[0] = script_name
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args             # <<<<<<<<<<<<<<
 *             with open(script_name) as f:
 *                 exec(f.read(), g, l)
 */
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_argv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_v_script_args, 1, 0, NULL, NULL, &__pyx_slice__22, 1, 0, 1) < 0) __PYX_ERR(0, 419, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "metaphor/monal/util/toolbox.py":418
 *         try:
 *             sys.argv[0] = script_name
 *             if script_args is not None:             # <<<<<<<<<<<<<<
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:
 */
        }

        /* "metaphor/monal/util/toolbox.py":420
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:             # <<<<<<<<<<<<<<
 *                 exec(f.read(), g, l)
 *         finally:
 */
        /*with:*/ {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_script_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 420, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (__pyx_t_10) {
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L13_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          } else {
            __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L13_error)
          }
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __pyx_t_2;
          __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          /*try:*/ {
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_11);
              __Pyx_XGOTREF(__pyx_t_12);
              __Pyx_XGOTREF(__pyx_t_13);
              /*try:*/ {
                __pyx_v_f = __pyx_t_9;
                __pyx_t_9 = 0;

                /* "metaphor/monal/util/toolbox.py":421
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:
 *                 exec(f.read(), g, l)             # <<<<<<<<<<<<<<
 *         finally:
 *             sys.argv = save_argv
 */
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_2 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
                  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
                  if (likely(__pyx_t_2)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                    __Pyx_INCREF(__pyx_t_2);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_1, function);
                  }
                }
                if (__pyx_t_2) {
                  __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 421, __pyx_L17_error)
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                } else {
                  __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 421, __pyx_L17_error)
                }
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyExec3(__pyx_t_9, __pyx_v_g, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                /* "metaphor/monal/util/toolbox.py":420
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:             # <<<<<<<<<<<<<<
 *                 exec(f.read(), g, l)
 *         finally:
 */
              }
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              goto __pyx_L22_try_end;
              __pyx_L17_error:;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              /*except:*/ {
                __Pyx_AddTraceback("metaphor.monal.util.toolbox.run_script", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L19_except_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_10 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 420, __pyx_L19_except_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 420, __pyx_L19_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                if (__pyx_t_7 < 0) __PYX_ERR(0, 420, __pyx_L19_except_error)
                __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0);
                if (__pyx_t_6) {
                  __Pyx_GIVEREF(__pyx_t_1);
                  __Pyx_GIVEREF(__pyx_t_9);
                  __Pyx_XGIVEREF(__pyx_t_2);
                  __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_9, __pyx_t_2);
                  __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_2 = 0; 
                  __PYX_ERR(0, 420, __pyx_L19_except_error)
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                goto __pyx_L18_exception_handled;
              }
              __pyx_L19_except_error:;
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              goto __pyx_L10_error;
              __pyx_L18_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              __pyx_L22_try_end:;
            }
          }
          /*finally:*/ {
            /*normal exit:*/{
              if (__pyx_t_8) {
                __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__23, NULL);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L10_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              }
              goto __pyx_L16;
            }
            __pyx_L16:;
          }
          goto __pyx_L26;
          __pyx_L13_error:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L10_error;
          __pyx_L26:;
        }
      }

      /* "metaphor/monal/util/toolbox.py":423
 *                 exec(f.read(), g, l)
 *         finally:
 *             sys.argv = save_argv             # <<<<<<<<<<<<<<
 *             #_setup_stop_after = None
 *     except SystemExit:
 */
      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_argv, __pyx_v_save_argv) < 0) __PYX_ERR(0, 423, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L11;
        }
        __pyx_L10_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_8 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_14, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_13, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_13, &__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_15 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_argv, __pyx_v_save_argv) < 0) __PYX_ERR(0, 423, __pyx_L28_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_14, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ErrRestore(__pyx_t_8, __pyx_t_13, __pyx_t_12);
          __pyx_t_8 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L3_error;
          __pyx_L28_error:;
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_14, __pyx_t_18);
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_18 = 0;
          goto __pyx_L3_error;
        }
        __pyx_L11:;
      }

      /* "metaphor/monal/util/toolbox.py":415
 *     g = {'__file__': script_name}
 *     l = {}
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             sys.argv[0] = script_name
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":425
 *             sys.argv = save_argv
 *             #_setup_stop_after = None
 *     except SystemExit:             # <<<<<<<<<<<<<<
 *         # Hmm, should we do something if exiting with a non-zero code
 *         # (ie. error)?
 */
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_SystemExit);
    if (__pyx_t_16) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.run_script", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_1) < 0) __PYX_ERR(0, 425, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_1);

      /* "metaphor/monal/util/toolbox.py":428
 *         # Hmm, should we do something if exiting with a non-zero code
 *         # (ie. error)?
 *         print(('Error in calling script "%s"'% script_name))             # <<<<<<<<<<<<<<
 *     except:
 *         raise
 */
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_Error_in_calling_script_s, __pyx_v_script_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 428, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_10); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 428, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4_exception_handled;
    }

    /* "metaphor/monal/util/toolbox.py":429
 *         # (ie. error)?
 *         print(('Error in calling script "%s"'% script_name))
 *     except:             # <<<<<<<<<<<<<<
 *         raise
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.run_script", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_2) < 0) __PYX_ERR(0, 429, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_2);

      /* "metaphor/monal/util/toolbox.py":430
 *         print(('Error in calling script "%s"'% script_name))
 *     except:
 *         raise             # <<<<<<<<<<<<<<
 * 
 * def dupescape(source):
 */
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_9, __pyx_t_2);
      __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_2 = 0; 
      __PYX_ERR(0, 430, __pyx_L5_except_error)
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":415
 *     g = {'__file__': script_name}
 *     l = {}
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             sys.argv[0] = script_name
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L8_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":411
 *         pass
 * 
 * def run_script(script_name, script_args=None):             # <<<<<<<<<<<<<<
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.run_script", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save_argv);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":432
 *         raise
 * 
 * def dupescape(source):             # <<<<<<<<<<<<<<
 *     lst = source.split('\\')
 *     return '\\\\'.join(lst)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_25dupescape(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_25dupescape = {"dupescape", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_25dupescape, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_25dupescape(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dupescape (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_24dupescape(__pyx_self, ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_24dupescape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dupescape", 0);

  /* "metaphor/monal/util/toolbox.py":433
 * 
 * def dupescape(source):
 *     lst = source.split('\\')             # <<<<<<<<<<<<<<
 *     return '\\\\'.join(lst)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_lst = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":434
 * def dupescape(source):
 *     lst = source.split('\\')
 *     return '\\\\'.join(lst)             # <<<<<<<<<<<<<<
 * 
 * def add2path(directory):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__26, __pyx_v_lst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":432
 *         raise
 * 
 * def dupescape(source):             # <<<<<<<<<<<<<<
 *     lst = source.split('\\')
 *     return '\\\\'.join(lst)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.dupescape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":436
 *     return '\\\\'.join(lst)
 * 
 * def add2path(directory):             # <<<<<<<<<<<<<<
 *     #import sys
 *     directory = os.path.normpath(directory)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_27add2path(PyObject *__pyx_self, PyObject *__pyx_v_directory); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_27add2path = {"add2path", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_27add2path, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_27add2path(PyObject *__pyx_self, PyObject *__pyx_v_directory) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add2path (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_26add2path(__pyx_self, ((PyObject *)__pyx_v_directory));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_26add2path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_directory) {
  PyObject *__pyx_v_dirr = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_dirloc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("add2path", 0);
  __Pyx_INCREF(__pyx_v_directory);

  /* "metaphor/monal/util/toolbox.py":438
 * def add2path(directory):
 *     #import sys
 *     directory = os.path.normpath(directory)             # <<<<<<<<<<<<<<
 *     dirr = os.path.normcase(directory)
 *     lst = sys.path
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_normpath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_directory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_directory};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_directory};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_directory);
      __Pyx_GIVEREF(__pyx_v_directory);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_directory);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_directory, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":439
 *     #import sys
 *     directory = os.path.normpath(directory)
 *     dirr = os.path.normcase(directory)             # <<<<<<<<<<<<<<
 *     lst = sys.path
 *     for dirloc in lst:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_normcase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_directory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_directory};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_directory};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_directory);
      __Pyx_GIVEREF(__pyx_v_directory);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_directory);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dirr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":440
 *     directory = os.path.normpath(directory)
 *     dirr = os.path.normcase(directory)
 *     lst = sys.path             # <<<<<<<<<<<<<<
 *     for dirloc in lst:
 *         if dirr == os.path.normcase(dirloc):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_lst = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":441
 *     dirr = os.path.normcase(directory)
 *     lst = sys.path
 *     for dirloc in lst:             # <<<<<<<<<<<<<<
 *         if dirr == os.path.normcase(dirloc):
 *             return
 */
  if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
    __pyx_t_2 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 441, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 441, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 441, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_dirloc, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":442
 *     lst = sys.path
 *     for dirloc in lst:
 *         if dirr == os.path.normcase(dirloc):             # <<<<<<<<<<<<<<
 *             return
 *     lst.insert(1, directory)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_normcase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dirloc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dirloc};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dirloc};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_dirloc);
        __Pyx_GIVEREF(__pyx_v_dirloc);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_dirloc);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __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_t_3 = PyObject_RichCompare(__pyx_v_dirr, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "metaphor/monal/util/toolbox.py":443
 *     for dirloc in lst:
 *         if dirr == os.path.normcase(dirloc):
 *             return             # <<<<<<<<<<<<<<
 *     lst.insert(1, directory)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "metaphor/monal/util/toolbox.py":442
 *     lst = sys.path
 *     for dirloc in lst:
 *         if dirr == os.path.normcase(dirloc):             # <<<<<<<<<<<<<<
 *             return
 *     lst.insert(1, directory)
 */
    }

    /* "metaphor/monal/util/toolbox.py":441
 *     dirr = os.path.normcase(directory)
 *     lst = sys.path
 *     for dirloc in lst:             # <<<<<<<<<<<<<<
 *         if dirr == os.path.normcase(dirloc):
 *             return
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":444
 *         if dirr == os.path.normcase(dirloc):
 *             return
 *     lst.insert(1, directory)             # <<<<<<<<<<<<<<
 * 
 * def removelinewith(filename, test):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_int_1, __pyx_v_directory};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_int_1, __pyx_v_directory};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_int_1);
    __Pyx_INCREF(__pyx_v_directory);
    __Pyx_GIVEREF(__pyx_v_directory);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_v_directory);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":436
 *     return '\\\\'.join(lst)
 * 
 * def add2path(directory):             # <<<<<<<<<<<<<<
 *     #import sys
 *     directory = os.path.normpath(directory)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.add2path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dirr);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_dirloc);
  __Pyx_XDECREF(__pyx_v_directory);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":446
 *     lst.insert(1, directory)
 * 
 * def removelinewith(filename, test):             # <<<<<<<<<<<<<<
 *     lst2 = []
 *     if os.path.exists(filename):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_29removelinewith(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_29removelinewith = {"removelinewith", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_29removelinewith, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_29removelinewith(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_test = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("removelinewith (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_test,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("removelinewith", 1, 2, 2, 1); __PYX_ERR(0, 446, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "removelinewith") < 0)) __PYX_ERR(0, 446, __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_test = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("removelinewith", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.removelinewith", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_28removelinewith(__pyx_self, __pyx_v_filename, __pyx_v_test);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_28removelinewith(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_test) {
  PyObject *__pyx_v_lst2 = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("removelinewith", 0);

  /* "metaphor/monal/util/toolbox.py":447
 * 
 * def removelinewith(filename, test):
 *     lst2 = []             # <<<<<<<<<<<<<<
 *     if os.path.exists(filename):
 *         with open(filename, "r") as f:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":448
 * def removelinewith(filename, test):
 *     lst2 = []
 *     if os.path.exists(filename):             # <<<<<<<<<<<<<<
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "metaphor/monal/util/toolbox.py":449
 *     lst2 = []
 *     if os.path.exists(filename):
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 */
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __Pyx_INCREF(__pyx_n_u_r);
      __Pyx_GIVEREF(__pyx_n_u_r);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_r);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L4_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_f = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":450
 *     if os.path.exists(filename):
 *         with open(filename, "r") as f:
 *             lst = f.readlines()             # <<<<<<<<<<<<<<
 *         lst2 = [val for val in lst if val.find(test) < 0]
 *         with open(filename, "w") as f:
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L8_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_lst = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":449
 *     lst2 = []
 *     if os.path.exists(filename):
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 */
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.monal.util.toolbox.removelinewith", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 449, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 449, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_5 < 0) __PYX_ERR(0, 449, __pyx_L10_except_error)
            __pyx_t_11 = ((!(__pyx_t_5 != 0)) != 0);
            if (__pyx_t_11) {
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_1);
              __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_1);
              __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
              __PYX_ERR(0, 449, __pyx_L10_except_error)
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_6) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__27, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L17;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L1_error;
      __pyx_L17:;
    }

    /* "metaphor/monal/util/toolbox.py":451
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]             # <<<<<<<<<<<<<<
 *         with open(filename, "w") as f:
 *             st = "".join(lst2)
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(!__pyx_v_lst)) { __Pyx_RaiseUnboundLocalError("lst"); __PYX_ERR(0, 451, __pyx_L20_error) }
      if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
        __pyx_t_2 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 451, __pyx_L20_error)
      }
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L20_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L20_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_13(__pyx_t_2);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 451, __pyx_L20_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_val, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_val, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_test};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_test};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
            __Pyx_INCREF(__pyx_v_test);
            __Pyx_GIVEREF(__pyx_v_test);
            PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_test);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L20_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 451, __pyx_L20_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_11) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr1__pyx_v_val))) __PYX_ERR(0, 451, __pyx_L20_error)
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val); __pyx_8genexpr1__pyx_v_val = 0;
      goto __pyx_L24_exit_scope;
      __pyx_L20_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val); __pyx_8genexpr1__pyx_v_val = 0;
      goto __pyx_L1_error;
      __pyx_L24_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_lst2, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":452
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 *         with open(filename, "w") as f:             # <<<<<<<<<<<<<<
 *             st = "".join(lst2)
 *             f.write(st)
 */
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __Pyx_INCREF(__pyx_n_u_w);
      __Pyx_GIVEREF(__pyx_n_u_w);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_w);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L25_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L25_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_7);
          /*try:*/ {
            __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "metaphor/monal/util/toolbox.py":453
 *         lst2 = [val for val in lst if val.find(test) < 0]
 *         with open(filename, "w") as f:
 *             st = "".join(lst2)             # <<<<<<<<<<<<<<
 *             f.write(st)
 * 
 */
            __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__17, __pyx_v_lst2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_v_st = ((PyObject*)__pyx_t_3);
            __pyx_t_3 = 0;

            /* "metaphor/monal/util/toolbox.py":454
 *         with open(filename, "w") as f:
 *             st = "".join(lst2)
 *             f.write(st)             # <<<<<<<<<<<<<<
 * 
 * def adduniqueline(line, filename):
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_3);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_2)) {
                PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_st};
                __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L29_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_3);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
                PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_st};
                __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L29_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_3);
              } else
              #endif
              {
                __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L29_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
                __Pyx_INCREF(__pyx_v_st);
                __Pyx_GIVEREF(__pyx_v_st);
                PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_st);
                __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L29_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "metaphor/monal/util/toolbox.py":452
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 *         with open(filename, "w") as f:             # <<<<<<<<<<<<<<
 *             st = "".join(lst2)
 *             f.write(st)
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L34_try_end;
          __pyx_L29_error:;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.monal.util.toolbox.removelinewith", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 452, __pyx_L31_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L31_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L31_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_11 < 0) __PYX_ERR(0, 452, __pyx_L31_except_error)
            __pyx_t_5 = ((!(__pyx_t_11 != 0)) != 0);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_4);
              __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; 
              __PYX_ERR(0, 452, __pyx_L31_except_error)
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L30_exception_handled;
          }
          __pyx_L31_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
          goto __pyx_L1_error;
          __pyx_L30_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
          __pyx_L34_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_6) {
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__28, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          goto __pyx_L28;
        }
        __pyx_L28:;
      }
      goto __pyx_L38;
      __pyx_L25_error:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L1_error;
      __pyx_L38:;
    }

    /* "metaphor/monal/util/toolbox.py":448
 * def removelinewith(filename, test):
 *     lst2 = []
 *     if os.path.exists(filename):             # <<<<<<<<<<<<<<
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 */
  }

  /* "metaphor/monal/util/toolbox.py":446
 *     lst.insert(1, directory)
 * 
 * def removelinewith(filename, test):             # <<<<<<<<<<<<<<
 *     lst2 = []
 *     if os.path.exists(filename):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.removelinewith", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst2);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":456
 *             f.write(st)
 * 
 * def adduniqueline(line, filename):             # <<<<<<<<<<<<<<
 *     OK = not os.path.exists(filename)
 *     if not OK:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_31adduniqueline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_31adduniqueline = {"adduniqueline", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_31adduniqueline, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_31adduniqueline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_line = 0;
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("adduniqueline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_line,&__pyx_n_s_filename,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("adduniqueline", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adduniqueline") < 0)) __PYX_ERR(0, 456, __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_line = values[0];
    __pyx_v_filename = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("adduniqueline", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.adduniqueline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_30adduniqueline(__pyx_self, __pyx_v_line, __pyx_v_filename);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_30adduniqueline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_filename) {
  int __pyx_v_OK;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  __Pyx_RefNannySetupContext("adduniqueline", 0);

  /* "metaphor/monal/util/toolbox.py":457
 * 
 * def adduniqueline(line, filename):
 *     OK = not os.path.exists(filename)             # <<<<<<<<<<<<<<
 *     if not OK:
 *         OK = True
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_OK = (!__pyx_t_5);

  /* "metaphor/monal/util/toolbox.py":458
 * def adduniqueline(line, filename):
 *     OK = not os.path.exists(filename)
 *     if not OK:             # <<<<<<<<<<<<<<
 *         OK = True
 *         lst = []
 */
  __pyx_t_5 = ((!(__pyx_v_OK != 0)) != 0);
  if (__pyx_t_5) {

    /* "metaphor/monal/util/toolbox.py":459
 *     OK = not os.path.exists(filename)
 *     if not OK:
 *         OK = True             # <<<<<<<<<<<<<<
 *         lst = []
 *         with open(filename, "r") as f:
 */
    __pyx_v_OK = 1;

    /* "metaphor/monal/util/toolbox.py":460
 *     if not OK:
 *         OK = True
 *         lst = []             # <<<<<<<<<<<<<<
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_lst = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":461
 *         OK = True
 *         lst = []
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         for st in lst:
 */
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __Pyx_INCREF(__pyx_n_u_r);
      __Pyx_GIVEREF(__pyx_n_u_r);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_r);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L4_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_f = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":462
 *         lst = []
 *         with open(filename, "r") as f:
 *             lst = f.readlines()             # <<<<<<<<<<<<<<
 *         for st in lst:
 *             if st.strip() == line:
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L8_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_4);
            __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":461
 *         OK = True
 *         lst = []
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         for st in lst:
 */
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.monal.util.toolbox.adduniqueline", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 461, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 461, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_5 < 0) __PYX_ERR(0, 461, __pyx_L10_except_error)
            __pyx_t_11 = ((!(__pyx_t_5 != 0)) != 0);
            if (__pyx_t_11) {
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_1);
              __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_1);
              __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
              __PYX_ERR(0, 461, __pyx_L10_except_error)
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_6) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__29, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L17;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L1_error;
      __pyx_L17:;
    }

    /* "metaphor/monal/util/toolbox.py":463
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 *         for st in lst:             # <<<<<<<<<<<<<<
 *             if st.strip() == line:
 *                 OK = False
 */
    if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
      __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 463, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_13(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 463, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_st, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/monal/util/toolbox.py":464
 *             lst = f.readlines()
 *         for st in lst:
 *             if st.strip() == line:             # <<<<<<<<<<<<<<
 *                 OK = False
 *                 break
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_line, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_11) {

        /* "metaphor/monal/util/toolbox.py":465
 *         for st in lst:
 *             if st.strip() == line:
 *                 OK = False             # <<<<<<<<<<<<<<
 *                 break
 *     if OK:
 */
        __pyx_v_OK = 0;

        /* "metaphor/monal/util/toolbox.py":466
 *             if st.strip() == line:
 *                 OK = False
 *                 break             # <<<<<<<<<<<<<<
 *     if OK:
 *         with open(filename, "a") as f:
 */
        goto __pyx_L19_break;

        /* "metaphor/monal/util/toolbox.py":464
 *             lst = f.readlines()
 *         for st in lst:
 *             if st.strip() == line:             # <<<<<<<<<<<<<<
 *                 OK = False
 *                 break
 */
      }

      /* "metaphor/monal/util/toolbox.py":463
 *         with open(filename, "r") as f:
 *             lst = f.readlines()
 *         for st in lst:             # <<<<<<<<<<<<<<
 *             if st.strip() == line:
 *                 OK = False
 */
    }
    __pyx_L19_break:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":458
 * def adduniqueline(line, filename):
 *     OK = not os.path.exists(filename)
 *     if not OK:             # <<<<<<<<<<<<<<
 *         OK = True
 *         lst = []
 */
  }

  /* "metaphor/monal/util/toolbox.py":467
 *                 OK = False
 *                 break
 *     if OK:             # <<<<<<<<<<<<<<
 *         with open(filename, "a") as f:
 *             f.write(line)
 */
  __pyx_t_11 = (__pyx_v_OK != 0);
  if (__pyx_t_11) {

    /* "metaphor/monal/util/toolbox.py":468
 *                 break
 *     if OK:
 *         with open(filename, "a") as f:             # <<<<<<<<<<<<<<
 *             f.write(line)
 *             f.write("\n")
 */
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __Pyx_INCREF(__pyx_n_u_a);
      __Pyx_GIVEREF(__pyx_n_u_a);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_a);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L22_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L22_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_7);
          /*try:*/ {
            __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "metaphor/monal/util/toolbox.py":469
 *     if OK:
 *         with open(filename, "a") as f:
 *             f.write(line)             # <<<<<<<<<<<<<<
 *             f.write("\n")
 * 
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L26_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L26_error)
              __Pyx_GOTREF(__pyx_t_2);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_line};
                __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L26_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_2);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_line};
                __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L26_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_2);
              } else
              #endif
              {
                __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L26_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
                __Pyx_INCREF(__pyx_v_line);
                __Pyx_GIVEREF(__pyx_v_line);
                PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_line);
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L26_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "metaphor/monal/util/toolbox.py":470
 *         with open(filename, "a") as f:
 *             f.write(line)
 *             f.write("\n")             # <<<<<<<<<<<<<<
 * 
 * def analyserange(rangestr):
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L26_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L26_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":468
 *                 break
 *     if OK:
 *         with open(filename, "a") as f:             # <<<<<<<<<<<<<<
 *             f.write(line)
 *             f.write("\n")
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L31_try_end;
          __pyx_L26_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.monal.util.toolbox.adduniqueline", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 468, __pyx_L28_except_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L28_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 468, __pyx_L28_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_11 < 0) __PYX_ERR(0, 468, __pyx_L28_except_error)
            __pyx_t_5 = ((!(__pyx_t_11 != 0)) != 0);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_3);
              __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
              __PYX_ERR(0, 468, __pyx_L28_except_error)
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L27_exception_handled;
          }
          __pyx_L28_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
          goto __pyx_L1_error;
          __pyx_L27_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
          __pyx_L31_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_6) {
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__31, NULL);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          goto __pyx_L25;
        }
        __pyx_L25:;
      }
      goto __pyx_L35;
      __pyx_L22_error:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L1_error;
      __pyx_L35:;
    }

    /* "metaphor/monal/util/toolbox.py":467
 *                 OK = False
 *                 break
 *     if OK:             # <<<<<<<<<<<<<<
 *         with open(filename, "a") as f:
 *             f.write(line)
 */
  }

  /* "metaphor/monal/util/toolbox.py":456
 *             f.write(st)
 * 
 * def adduniqueline(line, filename):             # <<<<<<<<<<<<<<
 *     OK = not os.path.exists(filename)
 *     if not OK:
 */

  /* 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("metaphor.monal.util.toolbox.adduniqueline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":472
 *             f.write("\n")
 * 
 * def analyserange(rangestr):             # <<<<<<<<<<<<<<
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_33analyserange(PyObject *__pyx_self, PyObject *__pyx_v_rangestr); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_33analyserange = {"analyserange", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_33analyserange, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_33analyserange(PyObject *__pyx_self, PyObject *__pyx_v_rangestr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("analyserange (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_32analyserange(__pyx_self, ((PyObject *)__pyx_v_rangestr));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_32analyserange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rangestr) {
  PyObject *__pyx_v_lst = NULL;
  Py_ssize_t __pyx_v_ll;
  PyObject *__pyx_v_worksheetstr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("analyserange", 0);
  __Pyx_INCREF(__pyx_v_rangestr);

  /* "metaphor/monal/util/toolbox.py":474
 * def analyserange(rangestr):
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")             # <<<<<<<<<<<<<<
 *     ll = len(lst)
 *     if ll == 2:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rangestr, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_lst = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":475
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")
 *     ll = len(lst)             # <<<<<<<<<<<<<<
 *     if ll == 2:
 *         worksheetstr = lst[0]
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 475, __pyx_L1_error)
  __pyx_v_ll = __pyx_t_3;

  /* "metaphor/monal/util/toolbox.py":476
 *     lst = rangestr.split("!")
 *     ll = len(lst)
 *     if ll == 2:             # <<<<<<<<<<<<<<
 *         worksheetstr = lst[0]
 *         rangestr = lst[1]
 */
  switch (__pyx_v_ll) {
    case 2:

    /* "metaphor/monal/util/toolbox.py":477
 *     ll = len(lst)
 *     if ll == 2:
 *         worksheetstr = lst[0]             # <<<<<<<<<<<<<<
 *         rangestr = lst[1]
 *     elif ll == 1:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_worksheetstr = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":478
 *     if ll == 2:
 *         worksheetstr = lst[0]
 *         rangestr = lst[1]             # <<<<<<<<<<<<<<
 *     elif ll == 1:
 *         worksheetstr = ""
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_rangestr, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":476
 *     lst = rangestr.split("!")
 *     ll = len(lst)
 *     if ll == 2:             # <<<<<<<<<<<<<<
 *         worksheetstr = lst[0]
 *         rangestr = lst[1]
 */
    break;

    /* "metaphor/monal/util/toolbox.py":479
 *         worksheetstr = lst[0]
 *         rangestr = lst[1]
 *     elif ll == 1:             # <<<<<<<<<<<<<<
 *         worksheetstr = ""
 *     return rangestr, worksheetstr
 */
    case 1:

    /* "metaphor/monal/util/toolbox.py":480
 *         rangestr = lst[1]
 *     elif ll == 1:
 *         worksheetstr = ""             # <<<<<<<<<<<<<<
 *     return rangestr, worksheetstr
 * 
 */
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_v_worksheetstr = __pyx_kp_u__17;

    /* "metaphor/monal/util/toolbox.py":479
 *         worksheetstr = lst[0]
 *         rangestr = lst[1]
 *     elif ll == 1:             # <<<<<<<<<<<<<<
 *         worksheetstr = ""
 *     return rangestr, worksheetstr
 */
    break;
    default: break;
  }

  /* "metaphor/monal/util/toolbox.py":481
 *     elif ll == 1:
 *         worksheetstr = ""
 *     return rangestr, worksheetstr             # <<<<<<<<<<<<<<
 * 
 * def getfiletype(path):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_worksheetstr)) { __Pyx_RaiseUnboundLocalError("worksheetstr"); __PYX_ERR(0, 481, __pyx_L1_error) }
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_rangestr);
  __Pyx_GIVEREF(__pyx_v_rangestr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rangestr);
  __Pyx_INCREF(__pyx_v_worksheetstr);
  __Pyx_GIVEREF(__pyx_v_worksheetstr);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_worksheetstr);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":472
 *             f.write("\n")
 * 
 * def analyserange(rangestr):             # <<<<<<<<<<<<<<
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.analyserange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_worksheetstr);
  __Pyx_XDECREF(__pyx_v_rangestr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":483
 *     return rangestr, worksheetstr
 * 
 * def getfiletype(path):             # <<<<<<<<<<<<<<
 *     st = os.path.splitext(path)[1]
 *     if st:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_35getfiletype(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_35getfiletype = {"getfiletype", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_35getfiletype, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_35getfiletype(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getfiletype (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_34getfiletype(__pyx_self, ((PyObject *)__pyx_v_path));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_34getfiletype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("getfiletype", 0);

  /* "metaphor/monal/util/toolbox.py":484
 * 
 * def getfiletype(path):
 *     st = os.path.splitext(path)[1]             # <<<<<<<<<<<<<<
 *     if st:
 *         return st[1:]
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_splitext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_path);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_st = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":485
 * def getfiletype(path):
 *     st = os.path.splitext(path)[1]
 *     if st:             # <<<<<<<<<<<<<<
 *         return st[1:]
 *     return st
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_st); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "metaphor/monal/util/toolbox.py":486
 *     st = os.path.splitext(path)[1]
 *     if st:
 *         return st[1:]             # <<<<<<<<<<<<<<
 *     return st
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_st, 1, 0, NULL, NULL, &__pyx_slice__34, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":485
 * def getfiletype(path):
 *     st = os.path.splitext(path)[1]
 *     if st:             # <<<<<<<<<<<<<<
 *         return st[1:]
 *     return st
 */
  }

  /* "metaphor/monal/util/toolbox.py":487
 *     if st:
 *         return st[1:]
 *     return st             # <<<<<<<<<<<<<<
 * 
 * def make_dir(dir_path, doprint=False, writer=sys.stdout, forbidden=[]):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_st);
  __pyx_r = __pyx_v_st;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":483
 *     return rangestr, worksheetstr
 * 
 * def getfiletype(path):             # <<<<<<<<<<<<<<
 *     st = os.path.splitext(path)[1]
 *     if st:
 */

  /* function 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("metaphor.monal.util.toolbox.getfiletype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":489
 *     return st
 * 
 * def make_dir(dir_path, doprint=False, writer=sys.stdout, forbidden=[]):             # <<<<<<<<<<<<<<
 *     """Wrapper for os.mkdir, that will not fail if directory
 *     already exists.
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_167__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_writer);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_writer);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_writer);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_forbidden);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_forbidden);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_forbidden);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_37make_dir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_36make_dir[] = "Wrapper for os.mkdir, that will not fail if directory\n    already exists.\n    If doprint is True and dir is created, writer is given \n    an information.\n    ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_37make_dir = {"make_dir", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_37make_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_36make_dir};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_37make_dir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dir_path = 0;
  PyObject *__pyx_v_doprint = 0;
  PyObject *__pyx_v_writer = 0;
  CYTHON_UNUSED PyObject *__pyx_v_forbidden = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_dir (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir_path,&__pyx_n_s_doprint,&__pyx_n_s_writer,&__pyx_n_s_forbidden,0};
    PyObject* values[4] = {0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = __pyx_dynamic_args->__pyx_arg_writer;
    values[3] = __pyx_dynamic_args->__pyx_arg_forbidden;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dir_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doprint);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_forbidden);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_dir") < 0)) __PYX_ERR(0, 489, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dir_path = values[0];
    __pyx_v_doprint = values[1];
    __pyx_v_writer = values[2];
    __pyx_v_forbidden = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_dir", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 489, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.make_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_36make_dir(__pyx_self, __pyx_v_dir_path, __pyx_v_doprint, __pyx_v_writer, __pyx_v_forbidden);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_36make_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir_path, PyObject *__pyx_v_doprint, PyObject *__pyx_v_writer, CYTHON_UNUSED PyObject *__pyx_v_forbidden) {
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("make_dir", 0);

  /* "metaphor/monal/util/toolbox.py":501
 * #         make_dir(folder, forbidden=forbidden)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":502
 * 
 *     try:
 *         os.makedirs(dir_path)             # <<<<<<<<<<<<<<
 *         if doprint and writer:
 *             try:
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_makedirs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dir_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dir_path};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dir_path};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_dir_path);
          __Pyx_GIVEREF(__pyx_v_dir_path);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_dir_path);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":503
 *     try:
 *         os.makedirs(dir_path)
 *         if doprint and writer:             # <<<<<<<<<<<<<<
 *             try:
 *                 writer.write("creating %s\n"% dir_path)
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_doprint); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 503, __pyx_L3_error)
      if (__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_writer); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 503, __pyx_L3_error)
      __pyx_t_8 = __pyx_t_9;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_8) {

        /* "metaphor/monal/util/toolbox.py":504
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 *             try:             # <<<<<<<<<<<<<<
 *                 writer.write("creating %s\n"% dir_path)
 *             except AttributeError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          /*try:*/ {

            /* "metaphor/monal/util/toolbox.py":505
 *         if doprint and writer:
 *             try:
 *                 writer.write("creating %s\n"% dir_path)             # <<<<<<<<<<<<<<
 *             except AttributeError:
 *                 pass
 */
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_creating_s, __pyx_v_dir_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_6, function);
              }
            }
            if (!__pyx_t_5) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L12_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_6)) {
                PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
                __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L12_error)
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
                PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
                __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L12_error)
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              } else
              #endif
              {
                __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 505, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __pyx_t_5 = NULL;
                __Pyx_GIVEREF(__pyx_t_7);
                PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_7);
                __pyx_t_7 = 0;
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "metaphor/monal/util/toolbox.py":504
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 *             try:             # <<<<<<<<<<<<<<
 *                 writer.write("creating %s\n"% dir_path)
 *             except AttributeError:
 */
          }
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L17_try_end;
          __pyx_L12_error:;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "metaphor/monal/util/toolbox.py":506
 *             try:
 *                 writer.write("creating %s\n"% dir_path)
 *             except AttributeError:             # <<<<<<<<<<<<<<
 *                 pass
 * #    except FileExistsError:
 */
          __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
          if (__pyx_t_14) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L13_exception_handled;
          }
          goto __pyx_L14_except_error;
          __pyx_L14_except_error:;

          /* "metaphor/monal/util/toolbox.py":504
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 *             try:             # <<<<<<<<<<<<<<
 *                 writer.write("creating %s\n"% dir_path)
 *             except AttributeError:
 */
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          goto __pyx_L3_error;
          __pyx_L13_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          __pyx_L17_try_end:;
        }

        /* "metaphor/monal/util/toolbox.py":503
 *     try:
 *         os.makedirs(dir_path)
 *         if doprint and writer:             # <<<<<<<<<<<<<<
 *             try:
 *                 writer.write("creating %s\n"% dir_path)
 */
      }

      /* "metaphor/monal/util/toolbox.py":501
 * #         make_dir(folder, forbidden=forbidden)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":511
 * #        pass
 * #    except FileNotFoundError as err:
 *     except OSError as err:             # <<<<<<<<<<<<<<
 *         if doprint:
 *             print(err, dir_path)
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError);
    if (__pyx_t_14) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.make_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_13) < 0) __PYX_ERR(0, 511, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":512
 * #    except FileNotFoundError as err:
 *     except OSError as err:
 *         if doprint:             # <<<<<<<<<<<<<<
 *             print(err, dir_path)
 * #        raise
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_doprint); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 512, __pyx_L23_error)
        if (__pyx_t_8) {

          /* "metaphor/monal/util/toolbox.py":513
 *     except OSError as err:
 *         if doprint:
 *             print(err, dir_path)             # <<<<<<<<<<<<<<
 * #        raise
 * #         import errno
 */
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_err);
          __Pyx_GIVEREF(__pyx_v_err);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_err);
          __Pyx_INCREF(__pyx_v_dir_path);
          __Pyx_GIVEREF(__pyx_v_dir_path);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_dir_path);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "metaphor/monal/util/toolbox.py":512
 * #    except FileNotFoundError as err:
 *     except OSError as err:
 *         if doprint:             # <<<<<<<<<<<<<<
 *             print(err, dir_path)
 * #        raise
 */
        }
      }

      /* "metaphor/monal/util/toolbox.py":511
 * #        pass
 * #    except FileNotFoundError as err:
 *     except OSError as err:             # <<<<<<<<<<<<<<
 *         if doprint:
 *             print(err, dir_path)
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L24;
        }
        __pyx_L23_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
          __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L24:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":501
 * #         make_dir(folder, forbidden=forbidden)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         os.makedirs(dir_path)
 *         if doprint and writer:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":489
 *     return st
 * 
 * def make_dir(dir_path, doprint=False, writer=sys.stdout, forbidden=[]):             # <<<<<<<<<<<<<<
 *     """Wrapper for os.mkdir, that will not fail if directory
 *     already exists.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.make_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":548
 * #         writer.write("cleaning %s\n"% dname)
 * 
 * def tempDir(name=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     if name:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_39tempDir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_39tempDir = {"tempDir", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_39tempDir, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_39tempDir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tempDir (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tempDir") < 0)) __PYX_ERR(0, 548, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tempDir", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 548, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.tempDir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_38tempDir(__pyx_self, __pyx_v_name);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_38tempDir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_mydir = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("tempDir", 0);

  /* "metaphor/monal/util/toolbox.py":549
 * 
 * def tempDir(name=""):
 *     mydir = tempfile.gettempdir()             # <<<<<<<<<<<<<<
 *     if name:
 *         mydir = os.path.join(dir, name)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gettempdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_mydir = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":550
 * def tempDir(name=""):
 *     mydir = tempfile.gettempdir()
 *     if name:             # <<<<<<<<<<<<<<
 *         mydir = os.path.join(dir, name)
 *     return mydir
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":551
 *     mydir = tempfile.gettempdir()
 *     if name:
 *         mydir = os.path.join(dir, name)             # <<<<<<<<<<<<<<
 *     return mydir
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_dir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_v_name};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_v_name};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __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_SET(__pyx_v_mydir, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":550
 * def tempDir(name=""):
 *     mydir = tempfile.gettempdir()
 *     if name:             # <<<<<<<<<<<<<<
 *         mydir = os.path.join(dir, name)
 *     return mydir
 */
  }

  /* "metaphor/monal/util/toolbox.py":552
 *     if name:
 *         mydir = os.path.join(dir, name)
 *     return mydir             # <<<<<<<<<<<<<<
 * 
 * def tempFileName(length=3, prefix="", suffix=""):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_mydir);
  __pyx_r = __pyx_v_mydir;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":548
 * #         writer.write("cleaning %s\n"% dname)
 * 
 * def tempDir(name=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     if name:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.tempDir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mydir);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":554
 *     return mydir
 * 
 * def tempFileName(length=3, prefix="", suffix=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_41tempFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_41tempFileName = {"tempFileName", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_41tempFileName, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_41tempFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_prefix = 0;
  PyObject *__pyx_v_suffix = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tempFileName (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_prefix,&__pyx_n_s_suffix,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)((PyObject *)__pyx_int_3));
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_suffix);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tempFileName") < 0)) __PYX_ERR(0, 554, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = values[0];
    __pyx_v_prefix = values[1];
    __pyx_v_suffix = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tempFileName", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.tempFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_40tempFileName(__pyx_self, __pyx_v_length, __pyx_v_prefix, __pyx_v_suffix);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_40tempFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_length, PyObject *__pyx_v_prefix, PyObject *__pyx_v_suffix) {
  PyObject *__pyx_v_mydir = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("tempFileName", 0);

  /* "metaphor/monal/util/toolbox.py":555
 * 
 * def tempFileName(length=3, prefix="", suffix=""):
 *     mydir = tempfile.gettempdir()             # <<<<<<<<<<<<<<
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 *     while os.path.exists(st):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gettempdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_mydir = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":556
 * def tempFileName(length=3, prefix="", suffix=""):
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))             # <<<<<<<<<<<<<<
 *     while os.path.exists(st):
 *         st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_prefix), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_aleastr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_length};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_length};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_length);
      __Pyx_GIVEREF(__pyx_v_length);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_length);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_suffix), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_mydir, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_mydir, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_mydir);
    __Pyx_GIVEREF(__pyx_v_mydir);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_v_mydir);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_st = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":557
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 *     while os.path.exists(st):             # <<<<<<<<<<<<<<
 *         st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 *     return st
 */
  while (1) {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_st); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_st};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_st};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_st);
        __Pyx_GIVEREF(__pyx_v_st);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_st);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __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_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_11) break;

    /* "metaphor/monal/util/toolbox.py":558
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 *     while os.path.exists(st):
 *         st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))             # <<<<<<<<<<<<<<
 *     return st
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_prefix), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_aleastr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_length};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_length};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_length);
        __Pyx_GIVEREF(__pyx_v_length);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_length);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_suffix), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_mydir, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_mydir, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_mydir);
      __Pyx_GIVEREF(__pyx_v_mydir);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_v_mydir);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_st, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "metaphor/monal/util/toolbox.py":559
 *     while os.path.exists(st):
 *         st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 *     return st             # <<<<<<<<<<<<<<
 * 
 * def getPythonPath():
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_st);
  __pyx_r = __pyx_v_st;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":554
 *     return mydir
 * 
 * def tempFileName(length=3, prefix="", suffix=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.tempFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mydir);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":561
 *     return st
 * 
 * def getPythonPath():             # <<<<<<<<<<<<<<
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_43getPythonPath(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_43getPythonPath = {"getPythonPath", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_43getPythonPath, METH_NOARGS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_43getPythonPath(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPythonPath (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_42getPythonPath(__pyx_self);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_42getPythonPath(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_lst = NULL;
  Py_ssize_t __pyx_v_l;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("getPythonPath", 0);

  /* "metaphor/monal/util/toolbox.py":562
 * 
 * def getPythonPath():
 *     try:             # <<<<<<<<<<<<<<
 *         return os.environ["PYTHONPATH"].split(";")
 *     except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":563
 * def getPythonPath():
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")             # <<<<<<<<<<<<<<
 *     except:
 *         #import sys
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_PYTHONPATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":562
 * 
 * def getPythonPath():
 *     try:             # <<<<<<<<<<<<<<
 *         return os.environ["PYTHONPATH"].split(";")
 *     except:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":564
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")
 *     except:             # <<<<<<<<<<<<<<
 *         #import sys
 *         lst = sys.path
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.getPythonPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 564, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "metaphor/monal/util/toolbox.py":566
 *     except:
 *         #import sys
 *         lst = sys.path             # <<<<<<<<<<<<<<
 *         l = 255
 *         n = -1
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_lst = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "metaphor/monal/util/toolbox.py":567
 *         #import sys
 *         lst = sys.path
 *         l = 255             # <<<<<<<<<<<<<<
 *         n = -1
 *         for i, val in enumerate(lst):
 */
      __pyx_v_l = 0xFF;

      /* "metaphor/monal/util/toolbox.py":568
 *         lst = sys.path
 *         l = 255
 *         n = -1             # <<<<<<<<<<<<<<
 *         for i, val in enumerate(lst):
 *             if 0 < len(val) < l:
 */
      __Pyx_INCREF(__pyx_int_neg_1);
      __pyx_v_n = __pyx_int_neg_1;

      /* "metaphor/monal/util/toolbox.py":569
 *         l = 255
 *         n = -1
 *         for i, val in enumerate(lst):             # <<<<<<<<<<<<<<
 *             if 0 < len(val) < l:
 *                 l = len(val)
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_8 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
        __pyx_t_7 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 569, __pyx_L5_except_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_7))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 569, __pyx_L5_except_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 569, __pyx_L5_except_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_7);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 569, __pyx_L5_except_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
        __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8);
        __pyx_t_8 = __pyx_t_11;
        __pyx_t_11 = 0;

        /* "metaphor/monal/util/toolbox.py":570
 *         n = -1
 *         for i, val in enumerate(lst):
 *             if 0 < len(val) < l:             # <<<<<<<<<<<<<<
 *                 l = len(val)
 *                 n = i
 */
        __pyx_t_12 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 570, __pyx_L5_except_error)
        __pyx_t_13 = (0 < __pyx_t_12);
        if (__pyx_t_13) {
          __pyx_t_13 = (__pyx_t_12 < __pyx_v_l);
        }
        __pyx_t_14 = (__pyx_t_13 != 0);
        if (__pyx_t_14) {

          /* "metaphor/monal/util/toolbox.py":571
 *         for i, val in enumerate(lst):
 *             if 0 < len(val) < l:
 *                 l = len(val)             # <<<<<<<<<<<<<<
 *                 n = i
 *         return lst[n]
 */
          __pyx_t_12 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 571, __pyx_L5_except_error)
          __pyx_v_l = __pyx_t_12;

          /* "metaphor/monal/util/toolbox.py":572
 *             if 0 < len(val) < l:
 *                 l = len(val)
 *                 n = i             # <<<<<<<<<<<<<<
 *         return lst[n]
 * 
 */
          __Pyx_INCREF(__pyx_v_i);
          __Pyx_DECREF_SET(__pyx_v_n, __pyx_v_i);

          /* "metaphor/monal/util/toolbox.py":570
 *         n = -1
 *         for i, val in enumerate(lst):
 *             if 0 < len(val) < l:             # <<<<<<<<<<<<<<
 *                 l = len(val)
 *                 n = i
 */
        }

        /* "metaphor/monal/util/toolbox.py":569
 *         l = 255
 *         n = -1
 *         for i, val in enumerate(lst):             # <<<<<<<<<<<<<<
 *             if 0 < len(val) < l:
 *                 l = len(val)
 */
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/monal/util/toolbox.py":573
 *                 l = len(val)
 *                 n = i
 *         return lst[n]             # <<<<<<<<<<<<<<
 * 
 * def addPythonPath(path, before=True):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":562
 * 
 * def getPythonPath():
 *     try:             # <<<<<<<<<<<<<<
 *         return os.environ["PYTHONPATH"].split(";")
 *     except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":561
 *     return st
 * 
 * def getPythonPath():             # <<<<<<<<<<<<<<
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getPythonPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":575
 *         return lst[n]
 * 
 * def addPythonPath(path, before=True):             # <<<<<<<<<<<<<<
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_45addPythonPath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_45addPythonPath = {"addPythonPath", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_45addPythonPath, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_45addPythonPath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_before = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addPythonPath (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_before,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_before);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addPythonPath") < 0)) __PYX_ERR(0, 575, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_before = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addPythonPath", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 575, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.addPythonPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_44addPythonPath(__pyx_self, __pyx_v_path, __pyx_v_before);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_44addPythonPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_before) {
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("addPythonPath", 0);

  /* "metaphor/monal/util/toolbox.py":576
 * 
 * def addPythonPath(path, before=True):
 *     if not path: return             # <<<<<<<<<<<<<<
 *     cur = os.environ["PYTHONPATH"]
 *     cur = cur.split(";")
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_path); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 576, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":577
 * def addPythonPath(path, before=True):
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]             # <<<<<<<<<<<<<<
 *     cur = cur.split(";")
 *     if before and isinstance(path, str):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_u_PYTHONPATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_cur = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":578
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 *     cur = cur.split(";")             # <<<<<<<<<<<<<<
 *     if before and isinstance(path, str):
 *         cur = [path] + cur
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_cur, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":579
 *     cur = os.environ["PYTHONPATH"]
 *     cur = cur.split(";")
 *     if before and isinstance(path, str):             # <<<<<<<<<<<<<<
 *         cur = [path] + cur
 *     elif before:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_before); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 579, __pyx_L1_error)
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PyUnicode_Check(__pyx_v_path); 
  __pyx_t_5 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":580
 *     cur = cur.split(";")
 *     if before and isinstance(path, str):
 *         cur = [path] + cur             # <<<<<<<<<<<<<<
 *     elif before:
 *         cur = path + cur
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_path);
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_cur); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":579
 *     cur = os.environ["PYTHONPATH"]
 *     cur = cur.split(";")
 *     if before and isinstance(path, str):             # <<<<<<<<<<<<<<
 *         cur = [path] + cur
 *     elif before:
 */
    goto __pyx_L4;
  }

  /* "metaphor/monal/util/toolbox.py":581
 *     if before and isinstance(path, str):
 *         cur = [path] + cur
 *     elif before:             # <<<<<<<<<<<<<<
 *         cur = path + cur
 *     elif isinstance(path, str):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_before); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 581, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":582
 *         cur = [path] + cur
 *     elif before:
 *         cur = path + cur             # <<<<<<<<<<<<<<
 *     elif isinstance(path, str):
 *         cur.append(path)
 */
    __pyx_t_3 = PyNumber_Add(__pyx_v_path, __pyx_v_cur); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":581
 *     if before and isinstance(path, str):
 *         cur = [path] + cur
 *     elif before:             # <<<<<<<<<<<<<<
 *         cur = path + cur
 *     elif isinstance(path, str):
 */
    goto __pyx_L4;
  }

  /* "metaphor/monal/util/toolbox.py":583
 *     elif before:
 *         cur = path + cur
 *     elif isinstance(path, str):             # <<<<<<<<<<<<<<
 *         cur.append(path)
 *     else:
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_path); 
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "metaphor/monal/util/toolbox.py":584
 *         cur = path + cur
 *     elif isinstance(path, str):
 *         cur.append(path)             # <<<<<<<<<<<<<<
 *     else:
 *         cur.extend(path)
 */
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_cur, __pyx_v_path); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error)

    /* "metaphor/monal/util/toolbox.py":583
 *     elif before:
 *         cur = path + cur
 *     elif isinstance(path, str):             # <<<<<<<<<<<<<<
 *         cur.append(path)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "metaphor/monal/util/toolbox.py":586
 *         cur.append(path)
 *     else:
 *         cur.extend(path)             # <<<<<<<<<<<<<<
 *     os.environ["PYTHONPATH"] = ";".join(cur)
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_extend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_path);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "metaphor/monal/util/toolbox.py":587
 *     else:
 *         cur.extend(path)
 *     os.environ["PYTHONPATH"] = ";".join(cur)             # <<<<<<<<<<<<<<
 * 
 * # def dataToStrList(data, dateindex=None, decimal=None):
 */
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__35, __pyx_v_cur); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_n_u_PYTHONPATH, __pyx_t_3) < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":575
 *         return lst[n]
 * 
 * def addPythonPath(path, before=True):             # <<<<<<<<<<<<<<
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.addPythonPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":610
 * #     return ";".join(dataToStrList(source, dateindex, decimal)) + "\n"
 * 
 * def slicexrange(aslice):             # <<<<<<<<<<<<<<
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_47slicexrange(PyObject *__pyx_self, PyObject *__pyx_v_aslice); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_47slicexrange = {"slicexrange", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_47slicexrange, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_47slicexrange(PyObject *__pyx_self, PyObject *__pyx_v_aslice) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slicexrange (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_46slicexrange(__pyx_self, ((PyObject *)__pyx_v_aslice));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_46slicexrange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aslice) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("slicexrange", 0);

  /* "metaphor/monal/util/toolbox.py":611
 * 
 * def slicexrange(aslice):
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))             # <<<<<<<<<<<<<<
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":612
 * def slicexrange(aslice):
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))             # <<<<<<<<<<<<<<
 * 
 * # def secToStr(secs, acc=3):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_aslice, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":610
 * #     return ";".join(dataToStrList(source, dateindex, decimal)) + "\n"
 * 
 * def slicexrange(aslice):             # <<<<<<<<<<<<<<
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.slicexrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":642
 * #     return max(date1, date2)
 * 
 * def alllist(source, sep=";"):             # <<<<<<<<<<<<<<
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_49alllist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_49alllist = {"alllist", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_49alllist, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_49alllist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_sep = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("alllist (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_sep,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u__35));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sep);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alllist") < 0)) __PYX_ERR(0, 642, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_sep = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("alllist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.alllist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_48alllist(__pyx_self, __pyx_v_source, __pyx_v_sep);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_48alllist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_sep) {
  PyObject *__pyx_8genexpr2__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  __Pyx_RefNannySetupContext("alllist", 0);

  /* "metaphor/monal/util/toolbox.py":643
 * 
 * def alllist(source, sep=";"):
 *     try:             # <<<<<<<<<<<<<<
 *         try: return [val.strip() for val in source.split(sep)]
 *         except: return list(source)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":644
 * def alllist(source, sep=";"):
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]             # <<<<<<<<<<<<<<
 *         except: return list(source)
 *     except: return source
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        /*try:*/ {
          __Pyx_XDECREF(__pyx_r);
          { /* enter inner scope */
            __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_10 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
              if (likely(__pyx_t_10)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
                __Pyx_INCREF(__pyx_t_10);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_9, function);
              }
            }
            if (!__pyx_t_10) {
              __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_sep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_8);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_9)) {
                PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_sep};
                __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_GOTREF(__pyx_t_8);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
                PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_sep};
                __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_GOTREF(__pyx_t_8);
              } else
              #endif
              {
                __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 644, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
                __Pyx_INCREF(__pyx_v_sep);
                __Pyx_GIVEREF(__pyx_v_sep);
                PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_sep);
                __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
              __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0;
              __pyx_t_13 = NULL;
            } else {
              __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 644, __pyx_L17_error)
            }
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            for (;;) {
              if (likely(!__pyx_t_13)) {
                if (likely(PyList_CheckExact(__pyx_t_9))) {
                  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 644, __pyx_L17_error)
                  #else
                  __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  #endif
                } else {
                  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 644, __pyx_L17_error)
                  #else
                  __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  #endif
                }
              } else {
                __pyx_t_8 = __pyx_t_13(__pyx_t_9);
                if (unlikely(!__pyx_t_8)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 644, __pyx_L17_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_8);
              }
              __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_val, __pyx_t_8);
              __pyx_t_8 = 0;
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_val, __pyx_n_s_strip); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 644, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_10 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
                __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
                if (likely(__pyx_t_10)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                  __Pyx_INCREF(__pyx_t_10);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_11, function);
                }
              }
              if (__pyx_t_10) {
                __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else {
                __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L17_error)
              }
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 644, __pyx_L17_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0;
            goto __pyx_L20_exit_scope;
            __pyx_L17_error:;
            __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0;
            goto __pyx_L9_error;
            __pyx_L20_exit_scope:;
          } /* exit inner scope */
          __pyx_r = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L13_try_return;
        }
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":645
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]
 *         except: return list(source)             # <<<<<<<<<<<<<<
 *     except: return source
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("metaphor.monal.util.toolbox.alllist", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 645, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_11 = PySequence_List(__pyx_v_source); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 645, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_r = __pyx_t_11;
          __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L12_except_return;
        }
        __pyx_L11_except_error:;

        /* "metaphor/monal/util/toolbox.py":644
 * def alllist(source, sep=";"):
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]             # <<<<<<<<<<<<<<
 *         except: return list(source)
 *     except: return source
 */
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L3_error;
        __pyx_L13_try_return:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L7_try_return;
        __pyx_L12_except_return:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L7_try_return;
      }

      /* "metaphor/monal/util/toolbox.py":643
 * 
 * def alllist(source, sep=";"):
 *     try:             # <<<<<<<<<<<<<<
 *         try: return [val.strip() for val in source.split(sep)]
 *         except: return list(source)
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/monal/util/toolbox.py":646
 *         try: return [val.strip() for val in source.split(sep)]
 *         except: return list(source)
 *     except: return source             # <<<<<<<<<<<<<<
 * 
 * def isfield(source):
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.alllist", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 646, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_source);
      __pyx_r = __pyx_v_source;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":643
 * 
 * def alllist(source, sep=";"):
 *     try:             # <<<<<<<<<<<<<<
 *         try: return [val.strip() for val in source.split(sep)]
 *         except: return list(source)
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":642
 * #     return max(date1, date2)
 * 
 * def alllist(source, sep=";"):             # <<<<<<<<<<<<<<
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.alllist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":648
 *     except: return source
 * 
 * def isfield(source):             # <<<<<<<<<<<<<<
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_51isfield(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_50isfield[] = "test de l'etat de champ de modele";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_51isfield = {"isfield", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_51isfield, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_50isfield};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_51isfield(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isfield (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_50isfield(__pyx_self, ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_50isfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_v_test = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("isfield", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "metaphor/monal/util/toolbox.py":650
 * def isfield(source):
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"             # <<<<<<<<<<<<<<
 *     lst = []
 *     res = re.findall(test, source)
 */
  __Pyx_INCREF(__pyx_kp_u_d_Z);
  __pyx_v_test = __pyx_kp_u_d_Z;

  /* "metaphor/monal/util/toolbox.py":651
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"
 *     lst = []             # <<<<<<<<<<<<<<
 *     res = re.findall(test, source)
 *     while len(res)==1:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":652
 *     test = r"\[\d+\]\Z"
 *     lst = []
 *     res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     while len(res)==1:
 *         item = res[0]
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_test);
    __Pyx_GIVEREF(__pyx_v_test);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_test);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_source);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":653
 *     lst = []
 *     res = re.findall(test, source)
 *     while len(res)==1:             # <<<<<<<<<<<<<<
 *         item = res[0]
 *         source = source[:-len(item)]
 */
  while (1) {
    __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 653, __pyx_L1_error)
    __pyx_t_7 = ((__pyx_t_6 == 1) != 0);
    if (!__pyx_t_7) break;

    /* "metaphor/monal/util/toolbox.py":654
 *     res = re.findall(test, source)
 *     while len(res)==1:
 *         item = res[0]             # <<<<<<<<<<<<<<
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":655
 *     while len(res)==1:
 *         item = res[0]
 *         source = source[:-len(item)]             # <<<<<<<<<<<<<<
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_item); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 655, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_source, 0, (-__pyx_t_6), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":656
 *         item = res[0]
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])             # <<<<<<<<<<<<<<
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_item, 1, -1L, NULL, NULL, &__pyx_slice__38, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_lst, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":657
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_test, __pyx_v_source};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_test, __pyx_v_source};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_test);
      __Pyx_GIVEREF(__pyx_v_test);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_test);
      __Pyx_INCREF(__pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_source);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "metaphor/monal/util/toolbox.py":658
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"             # <<<<<<<<<<<<<<
 *     res = re.findall(test, source)
 *     try: return (len(res) == 1) and (res[0] == source)
 */
  __Pyx_INCREF(__pyx_kp_u_A_A_Za_z__1_w_Z);
  __Pyx_DECREF_SET(__pyx_v_test, __pyx_kp_u_A_A_Za_z__1_w_Z);

  /* "metaphor/monal/util/toolbox.py":659
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     try: return (len(res) == 1) and (res[0] == source)
 *     except: return False
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_test);
    __Pyx_GIVEREF(__pyx_v_test);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_test);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_source);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":660
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 *     try: return (len(res) == 1) and (res[0] == source)             # <<<<<<<<<<<<<<
 *     except: return False
 * 
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 660, __pyx_L5_error)
      __pyx_t_7 = (__pyx_t_6 == 1);
      if (__pyx_t_7) {
      } else {
        __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_source, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L9_try_return;
    }
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":661
 *     res = re.findall(test, source)
 *     try: return (len(res) == 1) and (res[0] == source)
 *     except: return False             # <<<<<<<<<<<<<<
 * 
 * def splitfield(source):
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.isfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 661, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L8_except_return;
    }
    __pyx_L7_except_error:;

    /* "metaphor/monal/util/toolbox.py":660
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 *     try: return (len(res) == 1) and (res[0] == source)             # <<<<<<<<<<<<<<
 *     except: return False
 * 
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L0;
    __pyx_L8_except_return:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":648
 *     except: return source
 * 
 * def isfield(source):             # <<<<<<<<<<<<<<
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.isfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":663
 *     except: return False
 * 
 * def splitfield(source):             # <<<<<<<<<<<<<<
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_53splitfield(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_52splitfield[] = "eclatement d'un nom de champ de modele entre nom brut et retard";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_53splitfield = {"splitfield", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_53splitfield, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_52splitfield};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_53splitfield(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("splitfield (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_52splitfield(__pyx_self, ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_52splitfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_v_test = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("splitfield", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "metaphor/monal/util/toolbox.py":665
 * def splitfield(source):
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()             # <<<<<<<<<<<<<<
 *     test = r"\[\d+\]\Z"
 *     lst = []
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":666
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()
 *     test = r"\[\d+\]\Z"             # <<<<<<<<<<<<<<
 *     lst = []
 *     res = re.findall(test, source)
 */
  __Pyx_INCREF(__pyx_kp_u_d_Z);
  __pyx_v_test = __pyx_kp_u_d_Z;

  /* "metaphor/monal/util/toolbox.py":667
 *     source = source.strip()
 *     test = r"\[\d+\]\Z"
 *     lst = []             # <<<<<<<<<<<<<<
 *     res = re.findall(test, source)
 *     while len(res)==1:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":668
 *     test = r"\[\d+\]\Z"
 *     lst = []
 *     res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     while len(res)==1:
 *         item = res[0]
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_test);
    __Pyx_GIVEREF(__pyx_v_test);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_test);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_source);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":669
 *     lst = []
 *     res = re.findall(test, source)
 *     while len(res)==1:             # <<<<<<<<<<<<<<
 *         item = res[0]
 *         source = source[:-len(item)]
 */
  while (1) {
    __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 669, __pyx_L1_error)
    __pyx_t_7 = ((__pyx_t_6 == 1) != 0);
    if (!__pyx_t_7) break;

    /* "metaphor/monal/util/toolbox.py":670
 *     res = re.findall(test, source)
 *     while len(res)==1:
 *         item = res[0]             # <<<<<<<<<<<<<<
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":671
 *     while len(res)==1:
 *         item = res[0]
 *         source = source[:-len(item)]             # <<<<<<<<<<<<<<
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_item); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 671, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_source, 0, (-__pyx_t_6), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":672
 *         item = res[0]
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])             # <<<<<<<<<<<<<<
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_item, 1, -1L, NULL, NULL, &__pyx_slice__39, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_lst, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":673
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_test, __pyx_v_source};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_test, __pyx_v_source};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_test);
      __Pyx_GIVEREF(__pyx_v_test);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_test);
      __Pyx_INCREF(__pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_source);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "metaphor/monal/util/toolbox.py":674
 *         lst.append(item[1:-1])
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"             # <<<<<<<<<<<<<<
 *     res = re.findall(test, source)
 *     if (len(res) == 1) and (res[0] == source):
 */
  __Pyx_INCREF(__pyx_kp_u_A_A_Za_z__1_w_Z);
  __Pyx_DECREF_SET(__pyx_v_test, __pyx_kp_u_A_A_Za_z__1_w_Z);

  /* "metaphor/monal/util/toolbox.py":675
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)             # <<<<<<<<<<<<<<
 *     if (len(res) == 1) and (res[0] == source):
 *         if lst:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_test, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_test);
    __Pyx_GIVEREF(__pyx_v_test);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_test);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_source);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":676
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 *     if (len(res) == 1) and (res[0] == source):             # <<<<<<<<<<<<<<
 *         if lst:
 *             lst.reverse()
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_source, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_7) {

    /* "metaphor/monal/util/toolbox.py":677
 *     res = re.findall(test, source)
 *     if (len(res) == 1) and (res[0] == source):
 *         if lst:             # <<<<<<<<<<<<<<
 *             lst.reverse()
 *             if len(lst) > 1:
 */
    __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_lst) != 0);
    if (__pyx_t_7) {

      /* "metaphor/monal/util/toolbox.py":678
 *     if (len(res) == 1) and (res[0] == source):
 *         if lst:
 *             lst.reverse()             # <<<<<<<<<<<<<<
 *             if len(lst) > 1:
 *                 return source, tuple(lst)
 */
      __pyx_t_8 = PyList_Reverse(__pyx_v_lst); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 678, __pyx_L1_error)

      /* "metaphor/monal/util/toolbox.py":679
 *         if lst:
 *             lst.reverse()
 *             if len(lst) > 1:             # <<<<<<<<<<<<<<
 *                 return source, tuple(lst)
 *             else: return source, lst[0]
 */
      __pyx_t_6 = PyList_GET_SIZE(__pyx_v_lst); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 679, __pyx_L1_error)
      __pyx_t_7 = ((__pyx_t_6 > 1) != 0);
      if (__pyx_t_7) {

        /* "metaphor/monal/util/toolbox.py":680
 *             lst.reverse()
 *             if len(lst) > 1:
 *                 return source, tuple(lst)             # <<<<<<<<<<<<<<
 *             else: return source, lst[0]
 *         else: return source, None
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = PyList_AsTuple(__pyx_v_lst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L0;

        /* "metaphor/monal/util/toolbox.py":679
 *         if lst:
 *             lst.reverse()
 *             if len(lst) > 1:             # <<<<<<<<<<<<<<
 *                 return source, tuple(lst)
 *             else: return source, lst[0]
 */
      }

      /* "metaphor/monal/util/toolbox.py":681
 *             if len(lst) > 1:
 *                 return source, tuple(lst)
 *             else: return source, lst[0]             # <<<<<<<<<<<<<<
 *         else: return source, None
 *     return None, None
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
      }

      /* "metaphor/monal/util/toolbox.py":677
 *     res = re.findall(test, source)
 *     if (len(res) == 1) and (res[0] == source):
 *         if lst:             # <<<<<<<<<<<<<<
 *             lst.reverse()
 *             if len(lst) > 1:
 */
    }

    /* "metaphor/monal/util/toolbox.py":682
 *                 return source, tuple(lst)
 *             else: return source, lst[0]
 *         else: return source, None             # <<<<<<<<<<<<<<
 *     return None, None
 * 
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":676
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 *     res = re.findall(test, source)
 *     if (len(res) == 1) and (res[0] == source):             # <<<<<<<<<<<<<<
 *         if lst:
 *             lst.reverse()
 */
  }

  /* "metaphor/monal/util/toolbox.py":683
 *             else: return source, lst[0]
 *         else: return source, None
 *     return None, None             # <<<<<<<<<<<<<<
 * 
 * def rrange(start, stop=None, step=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_tuple__40);
  __pyx_r = __pyx_tuple__40;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":663
 *     except: return False
 * 
 * def splitfield(source):             # <<<<<<<<<<<<<<
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.splitfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_56generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":685
 *     return None, None
 * 
 * def rrange(start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *     if not step:
 *         step = 1.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_55rrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_55rrange = {"rrange", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_55rrange, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_55rrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rrange (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rrange") < 0)) __PYX_ERR(0, 685, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rrange", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 685, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.rrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_54rrange(__pyx_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_54rrange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rrange", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 685, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_start = __pyx_v_start;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start);
  __pyx_cur_scope->__pyx_v_stop = __pyx_v_stop;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stop);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stop);
  __pyx_cur_scope->__pyx_v_step = __pyx_v_step;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_step);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_step);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_56generator, __pyx_codeobj__41, (PyObject *) __pyx_cur_scope, __pyx_n_s_rrange, __pyx_n_s_rrange, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 685, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.rrange", __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_8metaphor_5monal_4util_7toolbox_56generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rrange", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 685, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":686
 * 
 * def rrange(start, stop=None, step=None):
 *     if not step:             # <<<<<<<<<<<<<<
 *         step = 1.0
 *     if stop is None:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_step); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 686, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":687
 * def rrange(start, stop=None, step=None):
 *     if not step:
 *         step = 1.0             # <<<<<<<<<<<<<<
 *     if stop is None:
 *         stop = start
 */
    __Pyx_INCREF(__pyx_float_1_0);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_step);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_step, __pyx_float_1_0);
    __Pyx_GIVEREF(__pyx_float_1_0);

    /* "metaphor/monal/util/toolbox.py":686
 * 
 * def rrange(start, stop=None, step=None):
 *     if not step:             # <<<<<<<<<<<<<<
 *         step = 1.0
 *     if stop is None:
 */
  }

  /* "metaphor/monal/util/toolbox.py":688
 *     if not step:
 *         step = 1.0
 *     if stop is None:             # <<<<<<<<<<<<<<
 *         stop = start
 *         start = 0.0
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_stop == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":689
 *         step = 1.0
 *     if stop is None:
 *         stop = start             # <<<<<<<<<<<<<<
 *         start = 0.0
 *     start = float(start)
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_stop);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_stop, __pyx_cur_scope->__pyx_v_start);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start);

    /* "metaphor/monal/util/toolbox.py":690
 *     if stop is None:
 *         stop = start
 *         start = 0.0             # <<<<<<<<<<<<<<
 *     start = float(start)
 *     stop = float(stop)
 */
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_start);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_start, __pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);

    /* "metaphor/monal/util/toolbox.py":688
 *     if not step:
 *         step = 1.0
 *     if stop is None:             # <<<<<<<<<<<<<<
 *         stop = start
 *         start = 0.0
 */
  }

  /* "metaphor/monal/util/toolbox.py":691
 *         stop = start
 *         start = 0.0
 *     start = float(start)             # <<<<<<<<<<<<<<
 *     stop = float(stop)
 *     cur = start
 */
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_start);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_start, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":692
 *         start = 0.0
 *     start = float(start)
 *     stop = float(stop)             # <<<<<<<<<<<<<<
 *     cur = start
 *     while cur < stop:
 */
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_v_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_stop);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_stop, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":693
 *     start = float(start)
 *     stop = float(stop)
 *     cur = start             # <<<<<<<<<<<<<<
 *     while cur < stop:
 *         yield cur
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start);
  __pyx_cur_scope->__pyx_v_cur = __pyx_cur_scope->__pyx_v_start;

  /* "metaphor/monal/util/toolbox.py":694
 *     stop = float(stop)
 *     cur = start
 *     while cur < stop:             # <<<<<<<<<<<<<<
 *         yield cur
 *         cur += step
 */
  while (1) {
    __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_cur, __pyx_cur_scope->__pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_1) break;

    /* "metaphor/monal/util/toolbox.py":695
 *     cur = start
 *     while cur < stop:
 *         yield cur             # <<<<<<<<<<<<<<
 *         cur += step
 *     raise StopIteration
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cur);
    __pyx_r = __pyx_cur_scope->__pyx_v_cur;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 695, __pyx_L1_error)

    /* "metaphor/monal/util/toolbox.py":696
 *     while cur < stop:
 *         yield cur
 *         cur += step             # <<<<<<<<<<<<<<
 *     raise StopIteration
 * 
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_cur, __pyx_cur_scope->__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_cur);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_cur, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "metaphor/monal/util/toolbox.py":697
 *         yield cur
 *         cur += step
 *     raise StopIteration             # <<<<<<<<<<<<<<
 * 
 * def boolstr(value):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(0, 697, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/monal/util/toolbox.py":685
 *     return None, None
 * 
 * def rrange(start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *     if not step:
 *         step = 1.0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("rrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":699
 *     raise StopIteration
 * 
 * def boolstr(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str):
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_58boolstr(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_58boolstr = {"boolstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_58boolstr, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_58boolstr(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("boolstr (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_57boolstr(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_57boolstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("boolstr", 0);

  /* "metaphor/monal/util/toolbox.py":700
 * 
 * def boolstr(value):
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         try:
 *             return bool(int(value))
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_value); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":701
 * def boolstr(value):
 *     if isinstance(value, str):
 *         try:             # <<<<<<<<<<<<<<
 *             return bool(int(value))
 *         except (ValueError, AttributeError):
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":702
 *     if isinstance(value, str):
 *         try:
 *             return bool(int(value))             # <<<<<<<<<<<<<<
 *         except (ValueError, AttributeError):
 *             return value.lower() in ["True", "true"]
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 702, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L8_try_return;

        /* "metaphor/monal/util/toolbox.py":701
 * def boolstr(value):
 *     if isinstance(value, str):
 *         try:             # <<<<<<<<<<<<<<
 *             return bool(int(value))
 *         except (ValueError, AttributeError):
 */
      }
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/monal/util/toolbox.py":703
 *         try:
 *             return bool(int(value))
 *         except (ValueError, AttributeError):             # <<<<<<<<<<<<<<
 *             return value.lower() in ["True", "true"]
 * 
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("metaphor.monal.util.toolbox.boolstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 703, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "metaphor/monal/util/toolbox.py":704
 *             return bool(int(value))
 *         except (ValueError, AttributeError):
 *             return value.lower() in ["True", "true"]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_lower); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (__pyx_t_12) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L6_except_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else {
          __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L6_except_error)
        }
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_10, __pyx_n_u_True, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 704, __pyx_L6_except_error)
        if (!__pyx_t_1) {
        } else {
          __pyx_t_2 = __pyx_t_1;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_10, __pyx_n_u_true, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 704, __pyx_L6_except_error)
        __pyx_t_2 = __pyx_t_1;
        __pyx_L12_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "metaphor/monal/util/toolbox.py":701
 * def boolstr(value):
 *     if isinstance(value, str):
 *         try:             # <<<<<<<<<<<<<<
 *             return bool(int(value))
 *         except (ValueError, AttributeError):
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":700
 * 
 * def boolstr(value):
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         try:
 *             return bool(int(value))
 */
  }

  /* "metaphor/monal/util/toolbox.py":699
 *     raise StopIteration
 * 
 * def boolstr(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str):
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.boolstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":707
 * 
 * 
 * def isnum(key):             # <<<<<<<<<<<<<<
 *     return isinstance(key, int)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_60isnum(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_60isnum = {"isnum", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_60isnum, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_60isnum(PyObject *__pyx_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnum (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_59isnum(__pyx_self, ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_59isnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("isnum", 0);

  /* "metaphor/monal/util/toolbox.py":708
 * 
 * def isnum(key):
 *     return isinstance(key, int)             # <<<<<<<<<<<<<<
 * 
 * def appendex(lst, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_Check(__pyx_v_key); 
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":707
 * 
 * 
 * def isnum(key):             # <<<<<<<<<<<<<<
 *     return isinstance(key, int)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.isnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":710
 *     return isinstance(key, int)
 * 
 * def appendex(lst, value):             # <<<<<<<<<<<<<<
 *     """extension de 'append' sans doublon"""
 *     try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_62appendex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_61appendex[] = "extension de 'append' sans doublon";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_62appendex = {"appendex", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_62appendex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_61appendex};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_62appendex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lst = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("appendex (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lst,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("appendex", 1, 2, 2, 1); __PYX_ERR(0, 710, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendex") < 0)) __PYX_ERR(0, 710, __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_lst = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 710, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.appendex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_61appendex(__pyx_self, __pyx_v_lst, __pyx_v_value);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_61appendex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("appendex", 0);

  /* "metaphor/monal/util/toolbox.py":712
 * def appendex(lst, value):
 *     """extension de 'append' sans doublon"""
 *     try:             # <<<<<<<<<<<<<<
 *         return lst.index(value)
 *     except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":713
 *     """extension de 'append' sans doublon"""
 *     try:
 *         return lst.index(value)             # <<<<<<<<<<<<<<
 *     except:
 *         lst.append(value)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 713, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":712
 * def appendex(lst, value):
 *     """extension de 'append' sans doublon"""
 *     try:             # <<<<<<<<<<<<<<
 *         return lst.index(value)
 *     except:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":714
 *     try:
 *         return lst.index(value)
 *     except:             # <<<<<<<<<<<<<<
 *         lst.append(value)
 *         return lst.index(value)
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.appendex", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 714, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);

      /* "metaphor/monal/util/toolbox.py":715
 *         return lst.index(value)
 *     except:
 *         lst.append(value)             # <<<<<<<<<<<<<<
 *         return lst.index(value)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_v_value); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 715, __pyx_L5_except_error)

      /* "metaphor/monal/util/toolbox.py":716
 *     except:
 *         lst.append(value)
 *         return lst.index(value)             # <<<<<<<<<<<<<<
 * 
 * def NDKdllName(levelmax=3, direct=False):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 716, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_9)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_value};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L5_except_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_value};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L5_except_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 716, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_value);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":712
 * def appendex(lst, value):
 *     """extension de 'append' sans doublon"""
 *     try:             # <<<<<<<<<<<<<<
 *         return lst.index(value)
 *     except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":710
 *     return isinstance(key, int)
 * 
 * def appendex(lst, value):             # <<<<<<<<<<<<<<
 *     """extension de 'append' sans doublon"""
 *     try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.appendex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":718
 *         return lst.index(value)
 * 
 * def NDKdllName(levelmax=3, direct=False):             # <<<<<<<<<<<<<<
 *     #import sys
 *     alevel = levelmax
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_64NDKdllName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_64NDKdllName = {"NDKdllName", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_64NDKdllName, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_64NDKdllName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_levelmax = 0;
  PyObject *__pyx_v_direct = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("NDKdllName (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levelmax,&__pyx_n_s_direct,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)((PyObject *)__pyx_int_3));
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levelmax);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_direct);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "NDKdllName") < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_levelmax = values[0];
    __pyx_v_direct = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("NDKdllName", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.NDKdllName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_63NDKdllName(__pyx_self, __pyx_v_levelmax, __pyx_v_direct);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_63NDKdllName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_levelmax, PyObject *__pyx_v_direct) {
  PyObject *__pyx_v_alevel = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_temp = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("NDKdllName", 0);

  /* "metaphor/monal/util/toolbox.py":720
 * def NDKdllName(levelmax=3, direct=False):
 *     #import sys
 *     alevel = levelmax             # <<<<<<<<<<<<<<
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):
 */
  __Pyx_INCREF(__pyx_v_levelmax);
  __pyx_v_alevel = __pyx_v_levelmax;

  /* "metaphor/monal/util/toolbox.py":721
 *     #import sys
 *     alevel = levelmax
 *     if not direct:             # <<<<<<<<<<<<<<
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_direct); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 721, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":722
 *     alevel = levelmax
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):             # <<<<<<<<<<<<<<
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_argv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_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_ERR(0, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __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_ERR(0, 722, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 722, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "metaphor/monal/util/toolbox.py":723
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):             # <<<<<<<<<<<<<<
 *                 try:
 *                     temp = int(arg[2:])
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_i); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_2) {

        /* "metaphor/monal/util/toolbox.py":724
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:             # <<<<<<<<<<<<<<
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "metaphor/monal/util/toolbox.py":725
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:
 *                     temp = int(arg[2:])             # <<<<<<<<<<<<<<
 *                     if temp < levelmax:
 *                         alevel = int(arg[2:])
 */
            __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_arg, 2, 0, NULL, NULL, &__pyx_slice__44, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 725, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_v_temp = __pyx_t_8;
            __pyx_t_8 = 0;

            /* "metaphor/monal/util/toolbox.py":726
 *                 try:
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:             # <<<<<<<<<<<<<<
 *                         alevel = int(arg[2:])
 *                 except: pass
 */
            __pyx_t_8 = PyObject_RichCompare(__pyx_v_temp, __pyx_v_levelmax, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 726, __pyx_L10_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 726, __pyx_L10_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (__pyx_t_2) {

              /* "metaphor/monal/util/toolbox.py":727
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:
 *                         alevel = int(arg[2:])             # <<<<<<<<<<<<<<
 *                 except: pass
 *                 break
 */
              __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_arg, 2, 0, NULL, NULL, &__pyx_slice__45, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 727, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF_SET(__pyx_v_alevel, __pyx_t_5);
              __pyx_t_5 = 0;

              /* "metaphor/monal/util/toolbox.py":726
 *                 try:
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:             # <<<<<<<<<<<<<<
 *                         alevel = int(arg[2:])
 *                 except: pass
 */
            }

            /* "metaphor/monal/util/toolbox.py":724
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:             # <<<<<<<<<<<<<<
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L17_try_end;
          __pyx_L10_error:;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "metaphor/monal/util/toolbox.py":728
 *                     if temp < levelmax:
 *                         alevel = int(arg[2:])
 *                 except: pass             # <<<<<<<<<<<<<<
 *                 break
 *     res = "MonaEx70.dll"
 */
          /*except:*/ {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L11_exception_handled;
          }
          __pyx_L11_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L17_try_end:;
        }

        /* "metaphor/monal/util/toolbox.py":729
 *                         alevel = int(arg[2:])
 *                 except: pass
 *                 break             # <<<<<<<<<<<<<<
 *     res = "MonaEx70.dll"
 *     for i in range(levelmax, 0, -1):
 */
        goto __pyx_L5_break;

        /* "metaphor/monal/util/toolbox.py":723
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):             # <<<<<<<<<<<<<<
 *                 try:
 *                     temp = int(arg[2:])
 */
      }

      /* "metaphor/monal/util/toolbox.py":722
 *     alevel = levelmax
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):             # <<<<<<<<<<<<<<
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:
 */
    }
    __pyx_L5_break:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":721
 *     #import sys
 *     alevel = levelmax
 *     if not direct:             # <<<<<<<<<<<<<<
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 */
  }

  /* "metaphor/monal/util/toolbox.py":730
 *                 except: pass
 *                 break
 *     res = "MonaEx70.dll"             # <<<<<<<<<<<<<<
 *     for i in range(levelmax, 0, -1):
 *         st = "Monaex70_%d.dll"% i
 */
  __Pyx_INCREF(__pyx_kp_u_MonaEx70_dll);
  __pyx_v_res = __pyx_kp_u_MonaEx70_dll;

  /* "metaphor/monal/util/toolbox.py":731
 *                 break
 *     res = "MonaEx70.dll"
 *     for i in range(levelmax, 0, -1):             # <<<<<<<<<<<<<<
 *         st = "Monaex70_%d.dll"% i
 *         if (alevel < i) and os.path.exists(st):
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_levelmax);
  __Pyx_GIVEREF(__pyx_v_levelmax);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_levelmax);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_neg_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 731, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":732
 *     res = "MonaEx70.dll"
 *     for i in range(levelmax, 0, -1):
 *         st = "Monaex70_%d.dll"% i             # <<<<<<<<<<<<<<
 *         if (alevel < i) and os.path.exists(st):
 *             res = st
 */
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Monaex70__d_dll, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_st, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":733
 *     for i in range(levelmax, 0, -1):
 *         st = "Monaex70_%d.dll"% i
 *         if (alevel < i) and os.path.exists(st):             # <<<<<<<<<<<<<<
 *             res = st
 *     return res, alevel
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_alevel, __pyx_v_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_st};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_st};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_st);
        __Pyx_GIVEREF(__pyx_v_st);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_st);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_2) {

      /* "metaphor/monal/util/toolbox.py":734
 *         st = "Monaex70_%d.dll"% i
 *         if (alevel < i) and os.path.exists(st):
 *             res = st             # <<<<<<<<<<<<<<
 *     return res, alevel
 * 
 */
      __Pyx_INCREF(__pyx_v_st);
      __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_st);

      /* "metaphor/monal/util/toolbox.py":733
 *     for i in range(levelmax, 0, -1):
 *         st = "Monaex70_%d.dll"% i
 *         if (alevel < i) and os.path.exists(st):             # <<<<<<<<<<<<<<
 *             res = st
 *     return res, alevel
 */
    }

    /* "metaphor/monal/util/toolbox.py":731
 *                 break
 *     res = "MonaEx70.dll"
 *     for i in range(levelmax, 0, -1):             # <<<<<<<<<<<<<<
 *         st = "Monaex70_%d.dll"% i
 *         if (alevel < i) and os.path.exists(st):
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":735
 *         if (alevel < i) and os.path.exists(st):
 *             res = st
 *     return res, alevel             # <<<<<<<<<<<<<<
 * 
 * def namefromfilename(filename):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_res);
  __Pyx_GIVEREF(__pyx_v_res);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_res);
  __Pyx_INCREF(__pyx_v_alevel);
  __Pyx_GIVEREF(__pyx_v_alevel);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_alevel);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":718
 *         return lst.index(value)
 * 
 * def NDKdllName(levelmax=3, direct=False):             # <<<<<<<<<<<<<<
 *     #import sys
 *     alevel = levelmax
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.NDKdllName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_alevel);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":737
 *     return res, alevel
 * 
 * def namefromfilename(filename):             # <<<<<<<<<<<<<<
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_66namefromfilename(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_66namefromfilename = {"namefromfilename", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_66namefromfilename, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_66namefromfilename(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("namefromfilename (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_65namefromfilename(__pyx_self, ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_65namefromfilename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("namefromfilename", 0);

  /* "metaphor/monal/util/toolbox.py":738
 * 
 * def namefromfilename(filename):
 *     result = os.path.split(filename)[1]             # <<<<<<<<<<<<<<
 *     result = '.'.join(result.split('.')[:-1])
 *     return result
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":739
 * def namefromfilename(filename):
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__48, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__46, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":740
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def inttohexstr(value, lmin=2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":737
 *     return res, alevel
 * 
 * def namefromfilename(filename):             # <<<<<<<<<<<<<<
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])
 */

  /* function 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("metaphor.monal.util.toolbox.namefromfilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":742
 *     return result
 * 
 * def inttohexstr(value, lmin=2):             # <<<<<<<<<<<<<<
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_68inttohexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_68inttohexstr = {"inttohexstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_68inttohexstr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_68inttohexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_lmin = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inttohexstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_lmin,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_2));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lmin);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inttohexstr") < 0)) __PYX_ERR(0, 742, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
    __pyx_v_lmin = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inttohexstr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 742, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.inttohexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_67inttohexstr(__pyx_self, __pyx_v_value, __pyx_v_lmin);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_67inttohexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_lmin) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("inttohexstr", 0);

  /* "metaphor/monal/util/toolbox.py":743
 * 
 * def inttohexstr(value, lmin=2):
 *     res = hex(value)[2:]             # <<<<<<<<<<<<<<
 *     res = "0"*(lmin - len(res)) + res
 *     return res
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 2, 0, NULL, NULL, &__pyx_slice__49, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":744
 * def inttohexstr(value, lmin=2):
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_lmin, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_kp_u_0, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":745
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res
 *     return res             # <<<<<<<<<<<<<<
 * 
 * def hexstrtoint(value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":742
 *     return result
 * 
 * def inttohexstr(value, lmin=2):             # <<<<<<<<<<<<<<
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.inttohexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":747
 *     return res
 * 
 * def hexstrtoint(value):             # <<<<<<<<<<<<<<
 *     return int(value, 16)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_70hexstrtoint(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_70hexstrtoint = {"hexstrtoint", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_70hexstrtoint, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_70hexstrtoint(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hexstrtoint (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_69hexstrtoint(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_69hexstrtoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("hexstrtoint", 0);

  /* "metaphor/monal/util/toolbox.py":748
 * 
 * def hexstrtoint(value):
 *     return int(value, 16)             # <<<<<<<<<<<<<<
 * 
 * def aleastr(ll):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __Pyx_INCREF(__pyx_int_16);
  __Pyx_GIVEREF(__pyx_int_16);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_16);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":747
 *     return res
 * 
 * def hexstrtoint(value):             # <<<<<<<<<<<<<<
 *     return int(value, 16)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.hexstrtoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":750
 *     return int(value, 16)
 * 
 * def aleastr(ll):             # <<<<<<<<<<<<<<
 *     res = ""
 *     while len(res) < ll:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_72aleastr(PyObject *__pyx_self, PyObject *__pyx_v_ll); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_72aleastr = {"aleastr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_72aleastr, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_72aleastr(PyObject *__pyx_self, PyObject *__pyx_v_ll) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("aleastr (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_71aleastr(__pyx_self, ((PyObject *)__pyx_v_ll));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_71aleastr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ll) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("aleastr", 0);

  /* "metaphor/monal/util/toolbox.py":751
 * 
 * def aleastr(ll):
 *     res = ""             # <<<<<<<<<<<<<<
 *     while len(res) < ll:
 *         n = random.randint(ord('A'), ord('Z'))
 */
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_v_res = __pyx_kp_u__17;

  /* "metaphor/monal/util/toolbox.py":752
 * def aleastr(ll):
 *     res = ""
 *     while len(res) < ll:             # <<<<<<<<<<<<<<
 *         n = random.randint(ord('A'), ord('Z'))
 *         res += chr(n)
 */
  while (1) {
    __pyx_t_1 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 752, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_ll, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_4) break;

    /* "metaphor/monal/util/toolbox.py":753
 *     res = ""
 *     while len(res) < ll:
 *         n = random.randint(ord('A'), ord('Z'))             # <<<<<<<<<<<<<<
 *         res += chr(n)
 *     return res
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":754
 *     while len(res) < ll:
 *         n = random.randint(ord('A'), ord('Z'))
 *         res += chr(n)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "metaphor/monal/util/toolbox.py":755
 *         n = random.randint(ord('A'), ord('Z'))
 *         res += chr(n)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * def strtolen(value, length):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":750
 *     return int(value, 16)
 * 
 * def aleastr(ll):             # <<<<<<<<<<<<<<
 *     res = ""
 *     while len(res) < ll:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.aleastr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":757
 *     return res
 * 
 * def strtolen(value, length):             # <<<<<<<<<<<<<<
 *     res = str(value)[:length]
 *     if len(res) < length:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_74strtolen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_74strtolen = {"strtolen", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_74strtolen, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_74strtolen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("strtolen (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_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);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("strtolen", 1, 2, 2, 1); __PYX_ERR(0, 757, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strtolen") < 0)) __PYX_ERR(0, 757, __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_value = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strtolen", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 757, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.strtolen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_73strtolen(__pyx_self, __pyx_v_value, __pyx_v_length);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_73strtolen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_length) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("strtolen", 0);

  /* "metaphor/monal/util/toolbox.py":758
 * 
 * def strtolen(value, length):
 *     res = str(value)[:length]             # <<<<<<<<<<<<<<
 *     if len(res) < length:
 *         res += aleastr(length - len(res))
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_t_1, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":759
 * def strtolen(value, length):
 *     res = str(value)[:length]
 *     if len(res) < length:             # <<<<<<<<<<<<<<
 *         res += aleastr(length - len(res))
 *     return res
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_length, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":760
 *     res = str(value)[:length]
 *     if len(res) < length:
 *         res += aleastr(length - len(res))             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_aleastr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 760, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_length, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __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_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":759
 * def strtolen(value, length):
 *     res = str(value)[:length]
 *     if len(res) < length:             # <<<<<<<<<<<<<<
 *         res += aleastr(length - len(res))
 *     return res
 */
  }

  /* "metaphor/monal/util/toolbox.py":761
 *     if len(res) < length:
 *         res += aleastr(length - len(res))
 *     return res             # <<<<<<<<<<<<<<
 * 
 * def interrogate(item):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":757
 *     return res
 * 
 * def strtolen(value, length):             # <<<<<<<<<<<<<<
 *     res = str(value)[:length]
 *     if len(res) < length:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.strtolen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":763
 *     return res
 * 
 * def interrogate(item):             # <<<<<<<<<<<<<<
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_76interrogate(PyObject *__pyx_self, PyObject *__pyx_v_item); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_75interrogate[] = "Print useful information about item.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_76interrogate = {"interrogate", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_76interrogate, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_75interrogate};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_76interrogate(PyObject *__pyx_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("interrogate (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_75interrogate(__pyx_self, ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_75interrogate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_doc = NULL;
  PyObject *__pyx_v_firstline = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("interrogate", 0);

  /* "metaphor/monal/util/toolbox.py":765
 * def interrogate(item):
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):             # <<<<<<<<<<<<<<
 *         print(("NAME:    ", item.__name__))
 *     if hasattr(item, '__class__'):
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_item, __pyx_n_u_name_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 765, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":766
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):
 *         print(("NAME:    ", item.__name__))             # <<<<<<<<<<<<<<
 *     if hasattr(item, '__class__'):
 *         print(("CLASS:   ", item.__class__.__name__))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_u_NAME);
    __Pyx_GIVEREF(__pyx_kp_u_NAME);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_NAME);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":765
 * def interrogate(item):
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):             # <<<<<<<<<<<<<<
 *         print(("NAME:    ", item.__name__))
 *     if hasattr(item, '__class__'):
 */
  }

  /* "metaphor/monal/util/toolbox.py":767
 *     if hasattr(item, '__name__'):
 *         print(("NAME:    ", item.__name__))
 *     if hasattr(item, '__class__'):             # <<<<<<<<<<<<<<
 *         print(("CLASS:   ", item.__class__.__name__))
 *     print(("ID:      ", id(item)))
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_item, __pyx_n_u_class); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 767, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":768
 *         print(("NAME:    ", item.__name__))
 *     if hasattr(item, '__class__'):
 *         print(("CLASS:   ", item.__class__.__name__))             # <<<<<<<<<<<<<<
 *     print(("ID:      ", id(item)))
 *     print(("TYPE:    ", type(item)))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_CLASS);
    __Pyx_GIVEREF(__pyx_kp_u_CLASS);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_CLASS);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":767
 *     if hasattr(item, '__name__'):
 *         print(("NAME:    ", item.__name__))
 *     if hasattr(item, '__class__'):             # <<<<<<<<<<<<<<
 *         print(("CLASS:   ", item.__class__.__name__))
 *     print(("ID:      ", id(item)))
 */
  }

  /* "metaphor/monal/util/toolbox.py":769
 *     if hasattr(item, '__class__'):
 *         print(("CLASS:   ", item.__class__.__name__))
 *     print(("ID:      ", id(item)))             # <<<<<<<<<<<<<<
 *     print(("TYPE:    ", type(item)))
 *     print(("VALUE:   ", repr(item)))
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_kp_u_ID);
  __Pyx_GIVEREF(__pyx_kp_u_ID);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_ID);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":770
 *         print(("CLASS:   ", item.__class__.__name__))
 *     print(("ID:      ", id(item)))
 *     print(("TYPE:    ", type(item)))             # <<<<<<<<<<<<<<
 *     print(("VALUE:   ", repr(item)))
 *     #print("CALLABLE:", end=' ')
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_kp_u_TYPE);
  __Pyx_GIVEREF(__pyx_kp_u_TYPE);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_TYPE);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_item)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_item)));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)Py_TYPE(__pyx_v_item)));
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":771
 *     print(("ID:      ", id(item)))
 *     print(("TYPE:    ", type(item)))
 *     print(("VALUE:   ", repr(item)))             # <<<<<<<<<<<<<<
 *     #print("CALLABLE:", end=' ')
 *     if isinstance(item, collections.Callable):
 */
  __pyx_t_3 = PyObject_Repr(__pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_kp_u_VALUE);
  __Pyx_GIVEREF(__pyx_kp_u_VALUE);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_VALUE);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":773
 *     print(("VALUE:   ", repr(item)))
 *     #print("CALLABLE:", end=' ')
 *     if isinstance(item, collections.Callable):             # <<<<<<<<<<<<<<
 *         print("CALLABLE: Yes")
 *     else:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_item, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":774
 *     #print("CALLABLE:", end=' ')
 *     if isinstance(item, collections.Callable):
 *         print("CALLABLE: Yes")             # <<<<<<<<<<<<<<
 *     else:
 *         print("CALLABLE: no")
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":773
 *     print(("VALUE:   ", repr(item)))
 *     #print("CALLABLE:", end=' ')
 *     if isinstance(item, collections.Callable):             # <<<<<<<<<<<<<<
 *         print("CALLABLE: Yes")
 *     else:
 */
    goto __pyx_L5;
  }

  /* "metaphor/monal/util/toolbox.py":776
 *         print("CALLABLE: Yes")
 *     else:
 *         print("CALLABLE: no")             # <<<<<<<<<<<<<<
 *     if hasattr(item, '__doc__'):
 *         doc = getattr(item, '__doc__')
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "metaphor/monal/util/toolbox.py":777
 *     else:
 *         print("CALLABLE: no")
 *     if hasattr(item, '__doc__'):             # <<<<<<<<<<<<<<
 *         doc = getattr(item, '__doc__')
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_item, __pyx_n_u_doc); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 777, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":778
 *         print("CALLABLE: no")
 *     if hasattr(item, '__doc__'):
 *         doc = getattr(item, '__doc__')             # <<<<<<<<<<<<<<
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 *     firstline = doc.split('\n')[0]
 */
    __pyx_t_4 = __Pyx_GetAttr(__pyx_v_item, __pyx_n_u_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_doc = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":777
 *     else:
 *         print("CALLABLE: no")
 *     if hasattr(item, '__doc__'):             # <<<<<<<<<<<<<<
 *         doc = getattr(item, '__doc__')
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 */
  }

  /* "metaphor/monal/util/toolbox.py":779
 *     if hasattr(item, '__doc__'):
 *         doc = getattr(item, '__doc__')
 *     doc = doc.strip()   # Remove leading/trailing whitespace.             # <<<<<<<<<<<<<<
 *     firstline = doc.split('\n')[0]
 *     print(("DOC:     ", firstline))
 */
  if (unlikely(!__pyx_v_doc)) { __Pyx_RaiseUnboundLocalError("doc"); __PYX_ERR(0, 779, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XDECREF_SET(__pyx_v_doc, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":780
 *         doc = getattr(item, '__doc__')
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 *     firstline = doc.split('\n')[0]             # <<<<<<<<<<<<<<
 *     print(("DOC:     ", firstline))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_firstline = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":781
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 *     firstline = doc.split('\n')[0]
 *     print(("DOC:     ", firstline))             # <<<<<<<<<<<<<<
 * 
 * # def findinlist(lst, key, noreturn=-1):
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_kp_u_DOC);
  __Pyx_GIVEREF(__pyx_kp_u_DOC);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_DOC);
  __Pyx_INCREF(__pyx_v_firstline);
  __Pyx_GIVEREF(__pyx_v_firstline);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_firstline);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":763
 *     return res
 * 
 * def interrogate(item):             # <<<<<<<<<<<<<<
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.interrogate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_doc);
  __Pyx_XDECREF(__pyx_v_firstline);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":807
 * #    else:
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):             # <<<<<<<<<<<<<<
 *     def setlen2(st):
 *         if len(st) >= 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_78datelong(PyObject *__pyx_self, PyObject *__pyx_v_datestr); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_78datelong = {"datelong", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_78datelong, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_78datelong(PyObject *__pyx_self, PyObject *__pyx_v_datestr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datelong (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_77datelong(__pyx_self, ((PyObject *)__pyx_v_datestr));

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

/* "metaphor/monal/util/toolbox.py":808
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):
 *     def setlen2(st):             # <<<<<<<<<<<<<<
 *         if len(st) >= 2:
 *             return st
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8datelong_1setlen2(PyObject *__pyx_self, PyObject *__pyx_v_st); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_8datelong_1setlen2 = {"setlen2", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_8datelong_1setlen2, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8datelong_1setlen2(PyObject *__pyx_self, PyObject *__pyx_v_st) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setlen2 (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_8datelong_setlen2(__pyx_self, ((PyObject *)__pyx_v_st));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8datelong_setlen2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_st) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("setlen2", 0);

  /* "metaphor/monal/util/toolbox.py":809
 * def datelong(datestr):
 *     def setlen2(st):
 *         if len(st) >= 2:             # <<<<<<<<<<<<<<
 *             return st
 *         return '0' + st
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_st); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 >= 2) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":810
 *     def setlen2(st):
 *         if len(st) >= 2:
 *             return st             # <<<<<<<<<<<<<<
 *         return '0' + st
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_st);
    __pyx_r = __pyx_v_st;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":809
 * def datelong(datestr):
 *     def setlen2(st):
 *         if len(st) >= 2:             # <<<<<<<<<<<<<<
 *             return st
 *         return '0' + st
 */
  }

  /* "metaphor/monal/util/toolbox.py":811
 *         if len(st) >= 2:
 *             return st
 *         return '0' + st             # <<<<<<<<<<<<<<
 * 
 *     mem = datestr.split()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyNumber_Add(__pyx_kp_u_0, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":808
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):
 *     def setlen2(st):             # <<<<<<<<<<<<<<
 *         if len(st) >= 2:
 *             return st
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.datelong.setlen2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":807
 * #    else:
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):             # <<<<<<<<<<<<<<
 *     def setlen2(st):
 *         if len(st) >= 2:
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_77datelong(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datestr) {
  PyObject *__pyx_v_setlen2 = 0;
  PyObject *__pyx_v_mem = NULL;
  PyObject *__pyx_v_datelst = NULL;
  PyObject *__pyx_v_day = NULL;
  PyObject *__pyx_v_month = NULL;
  PyObject *__pyx_v_date0 = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("datelong", 0);

  /* "metaphor/monal/util/toolbox.py":808
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):
 *     def setlen2(st):             # <<<<<<<<<<<<<<
 *         if len(st) >= 2:
 *             return st
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_8datelong_1setlen2, 0, __pyx_n_s_datelong_locals_setlen2, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_setlen2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":813
 *         return '0' + st
 * 
 *     mem = datestr.split()             # <<<<<<<<<<<<<<
 *     datelst = mem[0].split('/')
 *     day = setlen2(datelst[0])
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datestr, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_mem = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":814
 * 
 *     mem = datestr.split()
 *     datelst = mem[0].split('/')             # <<<<<<<<<<<<<<
 *     day = setlen2(datelst[0])
 *     month = setlen2(datelst[1])
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mem, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_datelst = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":815
 *     mem = datestr.split()
 *     datelst = mem[0].split('/')
 *     day = setlen2(datelst[0])             # <<<<<<<<<<<<<<
 *     month = setlen2(datelst[1])
 *     date0 = int(datelst[2])
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_datelst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_pf_8metaphor_5monal_4util_7toolbox_8datelong_setlen2(__pyx_v_setlen2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_day = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":816
 *     datelst = mem[0].split('/')
 *     day = setlen2(datelst[0])
 *     month = setlen2(datelst[1])             # <<<<<<<<<<<<<<
 *     date0 = int(datelst[2])
 *     if date0 < 70:
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_datelst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_pf_8metaphor_5monal_4util_7toolbox_8datelong_setlen2(__pyx_v_setlen2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_month = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":817
 *     day = setlen2(datelst[0])
 *     month = setlen2(datelst[1])
 *     date0 = int(datelst[2])             # <<<<<<<<<<<<<<
 *     if date0 < 70:
 *         date0 += 2000
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_datelst, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_date0 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":818
 *     month = setlen2(datelst[1])
 *     date0 = int(datelst[2])
 *     if date0 < 70:             # <<<<<<<<<<<<<<
 *         date0 += 2000
 *     elif date0 < 100:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_date0, __pyx_int_70, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":819
 *     date0 = int(datelst[2])
 *     if date0 < 70:
 *         date0 += 2000             # <<<<<<<<<<<<<<
 *     elif date0 < 100:
 *         date0 += 1900
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_date0, __pyx_int_2000, 0x7D0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_date0, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":818
 *     month = setlen2(datelst[1])
 *     date0 = int(datelst[2])
 *     if date0 < 70:             # <<<<<<<<<<<<<<
 *         date0 += 2000
 *     elif date0 < 100:
 */
    goto __pyx_L3;
  }

  /* "metaphor/monal/util/toolbox.py":820
 *     if date0 < 70:
 *         date0 += 2000
 *     elif date0 < 100:             # <<<<<<<<<<<<<<
 *         date0 += 1900
 *     st = '/'.join([day, month, str(date0)])
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_date0, __pyx_int_100, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":821
 *         date0 += 2000
 *     elif date0 < 100:
 *         date0 += 1900             # <<<<<<<<<<<<<<
 *     st = '/'.join([day, month, str(date0)])
 *     return ' '.join([st] + mem[1:])
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_date0, __pyx_int_1900, 0x76C, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_date0, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":820
 *     if date0 < 70:
 *         date0 += 2000
 *     elif date0 < 100:             # <<<<<<<<<<<<<<
 *         date0 += 1900
 *     st = '/'.join([day, month, str(date0)])
 */
  }
  __pyx_L3:;

  /* "metaphor/monal/util/toolbox.py":822
 *     elif date0 < 100:
 *         date0 += 1900
 *     st = '/'.join([day, month, str(date0)])             # <<<<<<<<<<<<<<
 *     return ' '.join([st] + mem[1:])
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_date0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_day);
  __Pyx_GIVEREF(__pyx_v_day);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_day);
  __Pyx_INCREF(__pyx_v_month);
  __Pyx_GIVEREF(__pyx_v_month);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_month);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__56, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_st = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":823
 *         date0 += 1900
 *     st = '/'.join([day, month, str(date0)])
 *     return ' '.join([st] + mem[1:])             # <<<<<<<<<<<<<<
 * 
 * def strCommon(A, B, caseSensitive = True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_st);
  __Pyx_GIVEREF(__pyx_v_st);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_st);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_mem, 1, 0, NULL, NULL, &__pyx_slice__59, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__58, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":807
 * #    else:
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):             # <<<<<<<<<<<<<<
 *     def setlen2(st):
 *         if len(st) >= 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.datelong", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_setlen2);
  __Pyx_XDECREF(__pyx_v_mem);
  __Pyx_XDECREF(__pyx_v_datelst);
  __Pyx_XDECREF(__pyx_v_day);
  __Pyx_XDECREF(__pyx_v_month);
  __Pyx_XDECREF(__pyx_v_date0);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":825
 *     return ' '.join([st] + mem[1:])
 * 
 * def strCommon(A, B, caseSensitive = True):             # <<<<<<<<<<<<<<
 *     if not caseSensitive:
 *         A = A.lower()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_80strCommon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_80strCommon = {"strCommon", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_80strCommon, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_80strCommon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_A = 0;
  PyObject *__pyx_v_B = 0;
  PyObject *__pyx_v_caseSensitive = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("strCommon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_caseSensitive,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("strCommon", 0, 2, 3, 1); __PYX_ERR(0, 825, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_caseSensitive);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strCommon") < 0)) __PYX_ERR(0, 825, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_A = values[0];
    __pyx_v_B = values[1];
    __pyx_v_caseSensitive = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strCommon", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 825, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.strCommon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_79strCommon(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_caseSensitive);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_79strCommon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_caseSensitive) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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 *);
  __Pyx_RefNannySetupContext("strCommon", 0);
  __Pyx_INCREF(__pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);

  /* "metaphor/monal/util/toolbox.py":826
 * 
 * def strCommon(A, B, caseSensitive = True):
 *     if not caseSensitive:             # <<<<<<<<<<<<<<
 *         A = A.lower()
 *         B = B.lower()
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_caseSensitive); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 826, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":827
 * def strCommon(A, B, caseSensitive = True):
 *     if not caseSensitive:
 *         A = A.lower()             # <<<<<<<<<<<<<<
 *         B = B.lower()
 *     n = 0
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_A, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":828
 *     if not caseSensitive:
 *         A = A.lower()
 *         B = B.lower()             # <<<<<<<<<<<<<<
 *     n = 0
 *     for a, b in zip(A, B):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_B, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":826
 * 
 * def strCommon(A, B, caseSensitive = True):
 *     if not caseSensitive:             # <<<<<<<<<<<<<<
 *         A = A.lower()
 *         B = B.lower()
 */
  }

  /* "metaphor/monal/util/toolbox.py":829
 *         A = A.lower()
 *         B = B.lower()
 *     n = 0             # <<<<<<<<<<<<<<
 *     for a, b in zip(A, B):
 *         if a == b: n += 1
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_n = __pyx_int_0;

  /* "metaphor/monal/util/toolbox.py":830
 *         B = B.lower()
 *     n = 0
 *     for a, b in zip(A, B):             # <<<<<<<<<<<<<<
 *         if a == b: n += 1
 *         else: break
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_A);
  __Pyx_GIVEREF(__pyx_v_A);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);
  __Pyx_GIVEREF(__pyx_v_B);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_B);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 830, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 830, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 830, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 830, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/monal/util/toolbox.py":831
 *     n = 0
 *     for a, b in zip(A, B):
 *         if a == b: n += 1             # <<<<<<<<<<<<<<
 *         else: break
 *     return n
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L8;
    }

    /* "metaphor/monal/util/toolbox.py":832
 *     for a, b in zip(A, B):
 *         if a == b: n += 1
 *         else: break             # <<<<<<<<<<<<<<
 *     return n
 * 
 */
    /*else*/ {
      goto __pyx_L5_break;
    }
    __pyx_L8:;

    /* "metaphor/monal/util/toolbox.py":830
 *         B = B.lower()
 *     n = 0
 *     for a, b in zip(A, B):             # <<<<<<<<<<<<<<
 *         if a == b: n += 1
 *         else: break
 */
  }
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":833
 *         if a == b: n += 1
 *         else: break
 *     return n             # <<<<<<<<<<<<<<
 * 
 * # def cmpstr(X, Y, fct=None, casesensitive=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_n);
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":825
 *     return ' '.join([st] + mem[1:])
 * 
 * def strCommon(A, B, caseSensitive = True):             # <<<<<<<<<<<<<<
 *     if not caseSensitive:
 *         A = A.lower()
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.strCommon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_83generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":880
 * #     return cmpstr(X, Y, getext)#lambda st: rpartition(st, '.')[2]
 * 
 * def getFilesByExt(directory, ext='', casesensitive=True):             # <<<<<<<<<<<<<<
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_82getFilesByExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_81getFilesByExt[] = " retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_82getFilesByExt = {"getFilesByExt", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_82getFilesByExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_81getFilesByExt};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_82getFilesByExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_directory = 0;
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_v_casesensitive = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFilesByExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_directory,&__pyx_n_s_ext,&__pyx_n_s_casesensitive,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[2] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_directory)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ext);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_casesensitive);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFilesByExt") < 0)) __PYX_ERR(0, 880, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_directory = values[0];
    __pyx_v_ext = values[1];
    __pyx_v_casesensitive = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFilesByExt", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 880, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getFilesByExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_81getFilesByExt(__pyx_self, __pyx_v_directory, __pyx_v_ext, __pyx_v_casesensitive);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_81getFilesByExt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_directory, PyObject *__pyx_v_ext, PyObject *__pyx_v_casesensitive) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFilesByExt", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 880, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_directory = __pyx_v_directory;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_directory);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_directory);
  __pyx_cur_scope->__pyx_v_ext = __pyx_v_ext;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ext);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ext);
  __pyx_cur_scope->__pyx_v_casesensitive = __pyx_v_casesensitive;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_casesensitive);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_casesensitive);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_83generator1, __pyx_codeobj__60, (PyObject *) __pyx_cur_scope, __pyx_n_s_getFilesByExt, __pyx_n_s_getFilesByExt, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 880, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getFilesByExt", __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_8metaphor_5monal_4util_7toolbox_83generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFilesByExt", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L11_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 880, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":882
 * def getFilesByExt(directory, ext='', casesensitive=True):
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:             # <<<<<<<<<<<<<<
 *         ext = ext.lower()
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_casesensitive); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":883
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 *         ext = ext.lower()             # <<<<<<<<<<<<<<
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 *         df = os.path.join(directory, f)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ext, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ext);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ext, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":882
 * def getFilesByExt(directory, ext='', casesensitive=True):
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:             # <<<<<<<<<<<<<<
 *         ext = ext.lower()
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 */
  }

  /* "metaphor/monal/util/toolbox.py":884
 *     if not casesensitive:
 *         ext = ext.lower()
 *     for f in cached_listdir(directory): # dircache.listdir(directory):             # <<<<<<<<<<<<<<
 *         df = os.path.join(directory, f)
 *         if not casesensitive:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cached_listdir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_directory); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_directory};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_directory};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_directory);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_directory);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_directory);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  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_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 884, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 884, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 884, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":885
 *         ext = ext.lower()
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 *         df = os.path.join(directory, f)             # <<<<<<<<<<<<<<
 *         if not casesensitive:
 *             lf = f.lower()
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_directory, __pyx_cur_scope->__pyx_v_f};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_directory, __pyx_cur_scope->__pyx_v_f};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_directory);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_directory);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_directory);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v_f);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_df);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_df, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":886
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 *         df = os.path.join(directory, f)
 *         if not casesensitive:             # <<<<<<<<<<<<<<
 *             lf = f.lower()
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_casesensitive); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 886, __pyx_L1_error)
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":887
 *         df = os.path.join(directory, f)
 *         if not casesensitive:
 *             lf = f.lower()             # <<<<<<<<<<<<<<
 *         else:
 *             lf = f
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_f, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_10) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lf);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lf, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":886
 *     for f in cached_listdir(directory): # dircache.listdir(directory):
 *         df = os.path.join(directory, f)
 *         if not casesensitive:             # <<<<<<<<<<<<<<
 *             lf = f.lower()
 *         else:
 */
      goto __pyx_L7;
    }

    /* "metaphor/monal/util/toolbox.py":889
 *             lf = f.lower()
 *         else:
 *             lf = f             # <<<<<<<<<<<<<<
 *         if lf.endswith(ext) and os.path.isfile(df):
 *             yield df
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lf);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_lf, __pyx_cur_scope->__pyx_v_f);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
    }
    __pyx_L7:;

    /* "metaphor/monal/util/toolbox.py":890
 *         else:
 *             lf = f
 *         if lf.endswith(ext) and os.path.isfile(df):             # <<<<<<<<<<<<<<
 *             yield df
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_lf, __pyx_n_s_endswith); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_ext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_ext};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_ext};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ext);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ext);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_cur_scope->__pyx_v_ext);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_df); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_df};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_df};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_df);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_df);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_cur_scope->__pyx_v_df);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":891
 *             lf = f
 *         if lf.endswith(ext) and os.path.isfile(df):
 *             yield df             # <<<<<<<<<<<<<<
 * 
 * class IndexValueError(IndexError):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_df);
      __pyx_r = __pyx_cur_scope->__pyx_v_df;
      __Pyx_XGIVEREF(__pyx_t_4);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L11_resume_from_yield:;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 891, __pyx_L1_error)

      /* "metaphor/monal/util/toolbox.py":890
 *         else:
 *             lf = f
 *         if lf.endswith(ext) and os.path.isfile(df):             # <<<<<<<<<<<<<<
 *             yield df
 * 
 */
    }

    /* "metaphor/monal/util/toolbox.py":884
 *     if not casesensitive:
 *         ext = ext.lower()
 *     for f in cached_listdir(directory): # dircache.listdir(directory):             # <<<<<<<<<<<<<<
 *         df = os.path.join(directory, f)
 *         if not casesensitive:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/monal/util/toolbox.py":880
 * #     return cmpstr(X, Y, getext)#lambda st: rpartition(st, '.')[2]
 * 
 * def getFilesByExt(directory, ext='', casesensitive=True):             # <<<<<<<<<<<<<<
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("getFilesByExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":898
 *         IndexError.__init__(self, mess)
 *         self._index = index
 *     index = property(lambda self: self._index)             # <<<<<<<<<<<<<<
 * 
 * def getIndexInVector(value, vector):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_2lambda(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_2lambda = {"lambda", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_2lambda, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_2lambda(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_lambda(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_lambda_funcdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.IndexValueError.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":895
 * class IndexValueError(IndexError):
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):             # <<<<<<<<<<<<<<
 *         IndexError.__init__(self, mess)
 *         self._index = index
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_15IndexValueError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_mess = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,&__pyx_n_s_mess,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_255));
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mess);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 895, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_index = values[1];
    __pyx_v_mess = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 895, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.IndexValueError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_15IndexValueError___init__(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_mess);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_15IndexValueError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_mess) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "metaphor/monal/util/toolbox.py":896
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):
 *         IndexError.__init__(self, mess)             # <<<<<<<<<<<<<<
 *         self._index = index
 *     index = property(lambda self: self._index)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_IndexError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_mess};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_mess};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_mess);
    __Pyx_GIVEREF(__pyx_v_mess);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_mess);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":897
 *     def __init__(self, index=0xFF, mess=''):
 *         IndexError.__init__(self, mess)
 *         self._index = index             # <<<<<<<<<<<<<<
 *     index = property(lambda self: self._index)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index_2, __pyx_v_index) < 0) __PYX_ERR(0, 897, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":895
 * class IndexValueError(IndexError):
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):             # <<<<<<<<<<<<<<
 *         IndexError.__init__(self, mess)
 *         self._index = index
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.IndexValueError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":900
 *     index = property(lambda self: self._index)
 * 
 * def getIndexInVector(value, vector):             # <<<<<<<<<<<<<<
 *     """Recherche de l'indice d'un parametre du vecteur.
 * Lorsque le parametre est connu par son nom, on determine son indice en
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_85getIndexInVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_84getIndexInVector[] = "Recherche de l'indice d'un parametre du vecteur.\nLorsque le parametre est connu par son nom, on determine son indice en \nrecherchant parmi tous les elements disponibles.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_85getIndexInVector = {"getIndexInVector", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_85getIndexInVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_84getIndexInVector};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_85getIndexInVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_vector = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getIndexInVector (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_vector,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vector)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getIndexInVector", 1, 2, 2, 1); __PYX_ERR(0, 900, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getIndexInVector") < 0)) __PYX_ERR(0, 900, __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_value = values[0];
    __pyx_v_vector = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getIndexInVector", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 900, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getIndexInVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_84getIndexInVector(__pyx_self, __pyx_v_value, __pyx_v_vector);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_84getIndexInVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_vector) {
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_ww = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("getIndexInVector", 0);

  /* "metaphor/monal/util/toolbox.py":904
 * Lorsque le parametre est connu par son nom, on determine son indice en
 * recherchant parmi tous les elements disponibles."""
 *     if isinstance(value, int):             # <<<<<<<<<<<<<<
 *         return value
 *     if isinstance(value, str):
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_value); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":905
 * recherchant parmi tous les elements disponibles."""
 *     if isinstance(value, int):
 *         return value             # <<<<<<<<<<<<<<
 *     if isinstance(value, str):
 *         for index, ww in enumerate(vector):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":904
 * Lorsque le parametre est connu par son nom, on determine son indice en
 * recherchant parmi tous les elements disponibles."""
 *     if isinstance(value, int):             # <<<<<<<<<<<<<<
 *         return value
 *     if isinstance(value, str):
 */
  }

  /* "metaphor/monal/util/toolbox.py":906
 *     if isinstance(value, int):
 *         return value
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         for index, ww in enumerate(vector):
 *             if ww.name == value:
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":907
 *         return value
 *     if isinstance(value, str):
 *         for index, ww in enumerate(vector):             # <<<<<<<<<<<<<<
 *             if ww.name == value:
 *                 return index
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_vector)) || PyTuple_CheckExact(__pyx_v_vector)) {
      __pyx_t_4 = __pyx_v_vector; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_vector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 907, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_ww, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3);
      __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "metaphor/monal/util/toolbox.py":908
 *     if isinstance(value, str):
 *         for index, ww in enumerate(vector):
 *             if ww.name == value:             # <<<<<<<<<<<<<<
 *                 return index
 *     return -1
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ww, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_1) {

        /* "metaphor/monal/util/toolbox.py":909
 *         for index, ww in enumerate(vector):
 *             if ww.name == value:
 *                 return index             # <<<<<<<<<<<<<<
 *     return -1
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_index);
        __pyx_r = __pyx_v_index;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L0;

        /* "metaphor/monal/util/toolbox.py":908
 *     if isinstance(value, str):
 *         for index, ww in enumerate(vector):
 *             if ww.name == value:             # <<<<<<<<<<<<<<
 *                 return index
 *     return -1
 */
      }

      /* "metaphor/monal/util/toolbox.py":907
 *         return value
 *     if isinstance(value, str):
 *         for index, ww in enumerate(vector):             # <<<<<<<<<<<<<<
 *             if ww.name == value:
 *                 return index
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":906
 *     if isinstance(value, int):
 *         return value
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         for index, ww in enumerate(vector):
 *             if ww.name == value:
 */
  }

  /* "metaphor/monal/util/toolbox.py":910
 *             if ww.name == value:
 *                 return index
 *     return -1             # <<<<<<<<<<<<<<
 * 
 * def getCVector(values, dim):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_r = __pyx_int_neg_1;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":900
 *     index = property(lambda self: self._index)
 * 
 * def getIndexInVector(value, vector):             # <<<<<<<<<<<<<<
 *     """Recherche de l'indice d'un parametre du vecteur.
 * Lorsque le parametre est connu par son nom, on determine son indice en
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getIndexInVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_ww);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":912
 *     return -1
 * 
 * def getCVector(values, dim):             # <<<<<<<<<<<<<<
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_87getCVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_87getCVector = {"getCVector", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_87getCVector, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_87getCVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_dim = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCVector (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_dim,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getCVector", 1, 2, 2, 1); __PYX_ERR(0, 912, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCVector") < 0)) __PYX_ERR(0, 912, __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_values = values[0];
    __pyx_v_dim = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCVector", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 912, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getCVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_86getCVector(__pyx_self, __pyx_v_values, __pyx_v_dim);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_86getCVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_dim) {
  Py_ssize_t __pyx_v_ll;
  PyObject *__pyx_v_cValues = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  __Pyx_RefNannySetupContext("getCVector", 0);

  /* "metaphor/monal/util/toolbox.py":913
 * 
 * def getCVector(values, dim):
 *     try:             # <<<<<<<<<<<<<<
 *         if (dim == 1) and isinstance(values, (int, float)):
 *             return c_double(values)
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":914
 * def getCVector(values, dim):
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):             # <<<<<<<<<<<<<<
 *             return c_double(values)
 *         ll = len ( values )
 */
      __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 914, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_7 = PyInt_Check(__pyx_v_values); 
      __pyx_t_8 = (__pyx_t_7 != 0);
      if (!__pyx_t_8) {
      } else {
        __pyx_t_6 = __pyx_t_8;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_8 = PyFloat_Check(__pyx_v_values); 
      __pyx_t_7 = (__pyx_t_8 != 0);
      __pyx_t_6 = __pyx_t_7;
      __pyx_L12_bool_binop_done:;
      __pyx_t_7 = (__pyx_t_6 != 0);
      __pyx_t_4 = __pyx_t_7;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_4) {

        /* "metaphor/monal/util/toolbox.py":915
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):
 *             return c_double(values)             # <<<<<<<<<<<<<<
 *         ll = len ( values )
 *         if ll != dim :
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_c_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 915, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_values};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_values};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L3_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 915, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_INCREF(__pyx_v_values);
            __Pyx_GIVEREF(__pyx_v_values);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_values);
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "metaphor/monal/util/toolbox.py":914
 * def getCVector(values, dim):
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):             # <<<<<<<<<<<<<<
 *             return c_double(values)
 *         ll = len ( values )
 */
      }

      /* "metaphor/monal/util/toolbox.py":916
 *         if (dim == 1) and isinstance(values, (int, float)):
 *             return c_double(values)
 *         ll = len ( values )             # <<<<<<<<<<<<<<
 *         if ll != dim :
 *             raise "Dimension error"
 */
      __pyx_t_12 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 916, __pyx_L3_error)
      __pyx_v_ll = __pyx_t_12;

      /* "metaphor/monal/util/toolbox.py":917
 *             return c_double(values)
 *         ll = len ( values )
 *         if ll != dim :             # <<<<<<<<<<<<<<
 *             raise "Dimension error"
 *         if isinstance(values, (list, tuple)):
 */
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 917, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_v_dim, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 917, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 917, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "metaphor/monal/util/toolbox.py":918
 *         ll = len ( values )
 *         if ll != dim :
 *             raise "Dimension error"             # <<<<<<<<<<<<<<
 *         if isinstance(values, (list, tuple)):
 *             cValues = (c_double * dim)()
 */
        __Pyx_Raise(__pyx_kp_u_Dimension_error, 0, 0, 0);
        __PYX_ERR(0, 918, __pyx_L3_error)

        /* "metaphor/monal/util/toolbox.py":917
 *             return c_double(values)
 *         ll = len ( values )
 *         if ll != dim :             # <<<<<<<<<<<<<<
 *             raise "Dimension error"
 *         if isinstance(values, (list, tuple)):
 */
      }

      /* "metaphor/monal/util/toolbox.py":919
 *         if ll != dim :
 *             raise "Dimension error"
 *         if isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *             cValues = (c_double * dim)()
 *             for i, val in enumerate(values):
 */
      __pyx_t_7 = PyList_Check(__pyx_v_values); 
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L16_bool_binop_done;
      }
      __pyx_t_6 = PyTuple_Check(__pyx_v_values); 
      __pyx_t_7 = (__pyx_t_6 != 0);
      __pyx_t_4 = __pyx_t_7;
      __pyx_L16_bool_binop_done:;
      __pyx_t_7 = (__pyx_t_4 != 0);
      if (__pyx_t_7) {

        /* "metaphor/monal/util/toolbox.py":920
 *             raise "Dimension error"
 *         if isinstance(values, (list, tuple)):
 *             cValues = (c_double * dim)()             # <<<<<<<<<<<<<<
 *             for i, val in enumerate(values):
 *                 cValues[i] = val
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_c_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = PyNumber_Multiply(__pyx_t_5, __pyx_v_dim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 920, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (__pyx_t_5) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 920, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 920, __pyx_L3_error)
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_v_cValues = __pyx_t_9;
        __pyx_t_9 = 0;

        /* "metaphor/monal/util/toolbox.py":921
 *         if isinstance(values, (list, tuple)):
 *             cValues = (c_double * dim)()
 *             for i, val in enumerate(values):             # <<<<<<<<<<<<<<
 *                 cValues[i] = val
 *             return cValues
 */
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_9 = __pyx_int_0;
        if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
          __pyx_t_11 = __pyx_v_values; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 921, __pyx_L3_error)
        }
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_11))) {
              if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 921, __pyx_L3_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 921, __pyx_L3_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_13(__pyx_t_11);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 921, __pyx_L3_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
          __pyx_t_5 = 0;
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
          __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9);
          __pyx_t_9 = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "metaphor/monal/util/toolbox.py":922
 *             cValues = (c_double * dim)()
 *             for i, val in enumerate(values):
 *                 cValues[i] = val             # <<<<<<<<<<<<<<
 *             return cValues
 *         else :
 */
          if (unlikely(PyObject_SetItem(__pyx_v_cValues, __pyx_v_i, __pyx_v_val) < 0)) __PYX_ERR(0, 922, __pyx_L3_error)

          /* "metaphor/monal/util/toolbox.py":921
 *         if isinstance(values, (list, tuple)):
 *             cValues = (c_double * dim)()
 *             for i, val in enumerate(values):             # <<<<<<<<<<<<<<
 *                 cValues[i] = val
 *             return cValues
 */
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "metaphor/monal/util/toolbox.py":923
 *             for i, val in enumerate(values):
 *                 cValues[i] = val
 *             return cValues             # <<<<<<<<<<<<<<
 *         else :
 *             return values
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_cValues);
        __pyx_r = __pyx_v_cValues;
        goto __pyx_L7_try_return;

        /* "metaphor/monal/util/toolbox.py":919
 *         if ll != dim :
 *             raise "Dimension error"
 *         if isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *             cValues = (c_double * dim)()
 *             for i, val in enumerate(values):
 */
      }

      /* "metaphor/monal/util/toolbox.py":925
 *             return cValues
 *         else :
 *             return values             # <<<<<<<<<<<<<<
 *     except: return None
 * 
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_values);
        __pyx_r = __pyx_v_values;
        goto __pyx_L7_try_return;
      }

      /* "metaphor/monal/util/toolbox.py":913
 * 
 * def getCVector(values, dim):
 *     try:             # <<<<<<<<<<<<<<
 *         if (dim == 1) and isinstance(values, (int, float)):
 *             return c_double(values)
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/monal/util/toolbox.py":926
 *         else :
 *             return values
 *     except: return None             # <<<<<<<<<<<<<<
 * 
 * def product(iterator, init=1):
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.getCVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_11, &__pyx_t_5) < 0) __PYX_ERR(0, 926, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":913
 * 
 * def getCVector(values, dim):
 *     try:             # <<<<<<<<<<<<<<
 *         if (dim == 1) and isinstance(values, (int, float)):
 *             return c_double(values)
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":912
 *     return -1
 * 
 * def getCVector(values, dim):             # <<<<<<<<<<<<<<
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getCVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cValues);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":928
 *     except: return None
 * 
 * def product(iterator, init=1):             # <<<<<<<<<<<<<<
 *     res = init
 *     for val in iterator: res *= val
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_89product(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_89product = {"product", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_89product, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_89product(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_iterator = 0;
  PyObject *__pyx_v_init = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("product (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iterator,&__pyx_n_s_init_2,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterator)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_2);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "product") < 0)) __PYX_ERR(0, 928, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_iterator = values[0];
    __pyx_v_init = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("product", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 928, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.product", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_88product(__pyx_self, __pyx_v_iterator, __pyx_v_init);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_88product(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iterator, PyObject *__pyx_v_init) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("product", 0);

  /* "metaphor/monal/util/toolbox.py":929
 * 
 * def product(iterator, init=1):
 *     res = init             # <<<<<<<<<<<<<<
 *     for val in iterator: res *= val
 *     return res
 */
  __Pyx_INCREF(__pyx_v_init);
  __pyx_v_res = __pyx_v_init;

  /* "metaphor/monal/util/toolbox.py":930
 * def product(iterator, init=1):
 *     res = init
 *     for val in iterator: res *= val             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_v_iterator)) {
    __pyx_t_1 = __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_v_iterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 930, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_res, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_4);
    __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":931
 *     res = init
 *     for val in iterator: res *= val
 *     return res             # <<<<<<<<<<<<<<
 * 
 * #def startswithEx(value, lst):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":928
 *     except: return None
 * 
 * def product(iterator, init=1):             # <<<<<<<<<<<<<<
 *     res = init
 *     for val in iterator: res *= val
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.product", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":949
 * #def justify(source, ):
 * 
 * def getindexstr(target, index, Func):             # <<<<<<<<<<<<<<
 *     """Lecture dans une bibliotheque d'une valeur string indexee. La fonction
 * Func doit retourner la longueur de la chaine lorsqu'elle est appelee avec une
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_91getindexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_90getindexstr[] = "Lecture dans une bibliotheque d'une valeur string indexee. La fonction \nFunc doit retourner la longueur de la chaine lorsqu'elle est appelee avec une \ncible Nulle. On cree un buffer, et la valeur d\303\203\302\257\303\202\302\277\303\202\305\223sir\303\203\302\257\303\202\302\277\303\202\305\223e est copiee dans celui-ci.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_91getindexstr = {"getindexstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_91getindexstr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_90getindexstr};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_91getindexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_Func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getindexstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target,&__pyx_n_s_index,&__pyx_n_s_Func,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getindexstr", 1, 3, 3, 1); __PYX_ERR(0, 949, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getindexstr", 1, 3, 3, 2); __PYX_ERR(0, 949, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getindexstr") < 0)) __PYX_ERR(0, 949, __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_target = values[0];
    __pyx_v_index = values[1];
    __pyx_v_Func = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getindexstr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 949, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getindexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_90getindexstr(__pyx_self, __pyx_v_target, __pyx_v_index, __pyx_v_Func);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_90getindexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_index, PyObject *__pyx_v_Func) {
  PyObject *__pyx_v_dim = NULL;
  PyObject *__pyx_v_targ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("getindexstr", 0);

  /* "metaphor/monal/util/toolbox.py":953
 * Func doit retourner la longueur de la chaine lorsqu'elle est appelee avec une
 * cible Nulle. On cree un buffer, et la valeur dsire est copiee dans celui-ci."""
 *     dim = Func(target, index, None)  #, 0             # <<<<<<<<<<<<<<
 *     targ = (c_char * (dim + 1))()
 *     Func(target, index, byref(targ))  #, dim
 */
  __Pyx_INCREF(__pyx_v_Func);
  __pyx_t_2 = __pyx_v_Func; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_target, __pyx_v_index, Py_None};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_target, __pyx_v_index, Py_None};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_target);
    __Pyx_GIVEREF(__pyx_v_target);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_target);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_index);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_None);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dim = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":954
 * cible Nulle. On cree un buffer, et la valeur dsire est copiee dans celui-ci."""
 *     dim = Func(target, index, None)  #, 0
 *     targ = (c_char * (dim + 1))()             # <<<<<<<<<<<<<<
 *     Func(target, index, byref(targ))  #, dim
 *     return targ.value
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_c_char); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_targ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":955
 *     dim = Func(target, index, None)  #, 0
 *     targ = (c_char * (dim + 1))()
 *     Func(target, index, byref(targ))  #, dim             # <<<<<<<<<<<<<<
 *     return targ.value
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_byref); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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_v_targ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_targ};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_targ};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_targ);
      __Pyx_GIVEREF(__pyx_v_targ);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_targ);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_v_Func);
  __pyx_t_5 = __pyx_v_Func; __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_target, __pyx_v_index, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_target, __pyx_v_index, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_target);
    __Pyx_GIVEREF(__pyx_v_target);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_target);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_index);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_4, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":956
 *     targ = (c_char * (dim + 1))()
 *     Func(target, index, byref(targ))  #, dim
 *     return targ.value             # <<<<<<<<<<<<<<
 * 
 * def get2indexstr(index1, index2, Func):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_targ, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":949
 * #def justify(source, ):
 * 
 * def getindexstr(target, index, Func):             # <<<<<<<<<<<<<<
 *     """Lecture dans une bibliotheque d'une valeur string indexee. La fonction
 * Func doit retourner la longueur de la chaine lorsqu'elle est appelee avec une
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.getindexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_v_targ);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":958
 *     return targ.value
 * 
 * def get2indexstr(index1, index2, Func):             # <<<<<<<<<<<<<<
 *     try:
 *         dim = Func(None, index1, index2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_93get2indexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_93get2indexstr = {"get2indexstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_93get2indexstr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_93get2indexstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index1 = 0;
  PyObject *__pyx_v_index2 = 0;
  PyObject *__pyx_v_Func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get2indexstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index1,&__pyx_n_s_index2,&__pyx_n_s_Func,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get2indexstr", 1, 3, 3, 1); __PYX_ERR(0, 958, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get2indexstr", 1, 3, 3, 2); __PYX_ERR(0, 958, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get2indexstr") < 0)) __PYX_ERR(0, 958, __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_index1 = values[0];
    __pyx_v_index2 = values[1];
    __pyx_v_Func = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get2indexstr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 958, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.get2indexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_92get2indexstr(__pyx_self, __pyx_v_index1, __pyx_v_index2, __pyx_v_Func);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_92get2indexstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index1, PyObject *__pyx_v_index2, PyObject *__pyx_v_Func) {
  PyObject *__pyx_v_dim = NULL;
  PyObject *__pyx_v_targ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("get2indexstr", 0);

  /* "metaphor/monal/util/toolbox.py":959
 * 
 * def get2indexstr(index1, index2, Func):
 *     try:             # <<<<<<<<<<<<<<
 *         dim = Func(None, index1, index2)
 *         if not dim: return ''
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":960
 * def get2indexstr(index1, index2, Func):
 *     try:
 *         dim = Func(None, index1, index2)             # <<<<<<<<<<<<<<
 *         if not dim: return ''
 *         targ = (c_char * (dim + 1))()
 */
      __Pyx_INCREF(__pyx_v_Func);
      __pyx_t_5 = __pyx_v_Func; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && 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);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, Py_None, __pyx_v_index1, __pyx_v_index2};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, Py_None, __pyx_v_index1, __pyx_v_index2};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 960, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, Py_None);
        __Pyx_INCREF(__pyx_v_index1);
        __Pyx_GIVEREF(__pyx_v_index1);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_index1);
        __Pyx_INCREF(__pyx_v_index2);
        __Pyx_GIVEREF(__pyx_v_index2);
        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_index2);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_dim = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":961
 *     try:
 *         dim = Func(None, index1, index2)
 *         if not dim: return ''             # <<<<<<<<<<<<<<
 *         targ = (c_char * (dim + 1))()
 *         Func(byref(targ), index1, index2)
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_dim); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 961, __pyx_L3_error)
      __pyx_t_10 = ((!__pyx_t_9) != 0);
      if (__pyx_t_10) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_kp_u__17);
        __pyx_r = __pyx_kp_u__17;
        goto __pyx_L7_try_return;
      }

      /* "metaphor/monal/util/toolbox.py":962
 *         dim = Func(None, index1, index2)
 *         if not dim: return ''
 *         targ = (c_char * (dim + 1))()             # <<<<<<<<<<<<<<
 *         Func(byref(targ), index1, index2)
 *         return targ.value
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_c_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 962, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_8) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_targ = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":963
 *         if not dim: return ''
 *         targ = (c_char * (dim + 1))()
 *         Func(byref(targ), index1, index2)             # <<<<<<<<<<<<<<
 *         return targ.value
 *     except: return ''
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_byref); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 963, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_targ); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_targ};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_targ};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_targ);
          __Pyx_GIVEREF(__pyx_v_targ);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_targ);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_v_Func);
      __pyx_t_8 = __pyx_v_Func; __pyx_t_11 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_t_6, __pyx_v_index1, __pyx_v_index2};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_t_6, __pyx_v_index1, __pyx_v_index2};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_11) {
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_index1);
        __Pyx_GIVEREF(__pyx_v_index1);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_index1);
        __Pyx_INCREF(__pyx_v_index2);
        __Pyx_GIVEREF(__pyx_v_index2);
        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_index2);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":964
 *         targ = (c_char * (dim + 1))()
 *         Func(byref(targ), index1, index2)
 *         return targ.value             # <<<<<<<<<<<<<<
 *     except: return ''
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_targ, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":959
 * 
 * def get2indexstr(index1, index2, Func):
 *     try:             # <<<<<<<<<<<<<<
 *         dim = Func(None, index1, index2)
 *         if not dim: return ''
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":965
 *         Func(byref(targ), index1, index2)
 *         return targ.value
 *     except: return ''             # <<<<<<<<<<<<<<
 * 
 * #def existingabsfile(filename, top="C:\\"):
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.get2indexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_5) < 0) __PYX_ERR(0, 965, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_r = __pyx_kp_u__17;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":959
 * 
 * def get2indexstr(index1, index2, Func):
 *     try:             # <<<<<<<<<<<<<<
 *         dim = Func(None, index1, index2)
 *         if not dim: return ''
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":958
 *     return targ.value
 * 
 * def get2indexstr(index1, index2, Func):             # <<<<<<<<<<<<<<
 *     try:
 *         dim = Func(None, index1, index2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.get2indexstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_v_targ);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":974
 * #            return os.path.join(res[0], filename)
 * 
 * def LoadConfig(myfile, config={}):             # <<<<<<<<<<<<<<
 *     """Returns a dictionary with key's of the form
 * <section>.<option> and the values."""
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_169__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_config);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_config);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_config);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_95LoadConfig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_94LoadConfig[] = "Returns a dictionary with key's of the form\n<section>.<option> and the values.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_95LoadConfig = {"LoadConfig", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_95LoadConfig, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_94LoadConfig};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_95LoadConfig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_myfile = 0;
  PyObject *__pyx_v_config = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("LoadConfig (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_myfile,&__pyx_n_s_config,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_config;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_myfile)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_config);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "LoadConfig") < 0)) __PYX_ERR(0, 974, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_myfile = values[0];
    __pyx_v_config = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("LoadConfig", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 974, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.LoadConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_94LoadConfig(__pyx_self, __pyx_v_myfile, __pyx_v_config);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_94LoadConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_myfile, PyObject *__pyx_v_config) {
  PyObject *__pyx_v_cp = NULL;
  PyObject *__pyx_v_sec = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_opt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("LoadConfig", 0);
  __Pyx_INCREF(__pyx_v_config);

  /* "metaphor/monal/util/toolbox.py":978
 * <section>.<option> and the values."""
 *     #import configparser
 *     config = config.copy()             # <<<<<<<<<<<<<<
 *     cp = ConfigParser()
 *     cp.read(myfile)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":979
 *     #import configparser
 *     config = config.copy()
 *     cp = ConfigParser()             # <<<<<<<<<<<<<<
 *     cp.read(myfile)
 *     for sec in cp.sections():
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ConfigParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":980
 *     config = config.copy()
 *     cp = ConfigParser()
 *     cp.read(myfile)             # <<<<<<<<<<<<<<
 *     for sec in cp.sections():
 *         name = sec.lower()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cp, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_myfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_myfile};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_myfile};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_myfile);
      __Pyx_GIVEREF(__pyx_v_myfile);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_myfile);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":981
 *     cp = ConfigParser()
 *     cp.read(myfile)
 *     for sec in cp.sections():             # <<<<<<<<<<<<<<
 *         name = sec.lower()
 *         #string.lower(sec)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cp, __pyx_n_s_sections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 981, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_sec, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":982
 *     cp.read(myfile)
 *     for sec in cp.sections():
 *         name = sec.lower()             # <<<<<<<<<<<<<<
 *         #string.lower(sec)
 *         for opt in cp.options(sec):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sec, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":984
 *         name = sec.lower()
 *         #string.lower(sec)
 *         for opt in cp.options(sec):             # <<<<<<<<<<<<<<
 *             config[name + "." + opt.lower()] = cp.get(sec, opt).strip()
 * #            config[name + "." + string.lower(opt)] = string.strip(cp.get(sec, opt))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cp, __pyx_n_s_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_sec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_sec};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_sec};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_sec);
        __Pyx_GIVEREF(__pyx_v_sec);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_sec);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __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;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_9(__pyx_t_4);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 984, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_opt, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":985
 *         #string.lower(sec)
 *         for opt in cp.options(sec):
 *             config[name + "." + opt.lower()] = cp.get(sec, opt).strip()             # <<<<<<<<<<<<<<
 * #            config[name + "." + string.lower(opt)] = string.strip(cp.get(sec, opt))
 *     return config
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cp, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_sec, __pyx_v_opt};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_sec, __pyx_v_opt};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_sec);
        __Pyx_GIVEREF(__pyx_v_sec);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_sec);
        __Pyx_INCREF(__pyx_v_opt);
        __Pyx_GIVEREF(__pyx_v_opt);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_opt);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_name, __pyx_kp_u__46); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_opt, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (__pyx_t_10) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_config, __pyx_t_12, __pyx_t_1) < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":984
 *         name = sec.lower()
 *         #string.lower(sec)
 *         for opt in cp.options(sec):             # <<<<<<<<<<<<<<
 *             config[name + "." + opt.lower()] = cp.get(sec, opt).strip()
 * #            config[name + "." + string.lower(opt)] = string.strip(cp.get(sec, opt))
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":981
 *     cp = ConfigParser()
 *     cp.read(myfile)
 *     for sec in cp.sections():             # <<<<<<<<<<<<<<
 *         name = sec.lower()
 *         #string.lower(sec)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":987
 *             config[name + "." + opt.lower()] = cp.get(sec, opt).strip()
 * #            config[name + "." + string.lower(opt)] = string.strip(cp.get(sec, opt))
 *     return config             # <<<<<<<<<<<<<<
 * 
 * def checkIndex(val, minincluded, maxexcluded):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_config);
  __pyx_r = __pyx_v_config;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":974
 * #            return os.path.join(res[0], filename)
 * 
 * def LoadConfig(myfile, config={}):             # <<<<<<<<<<<<<<
 *     """Returns a dictionary with key's of the form
 * <section>.<option> and the values."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.LoadConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cp);
  __Pyx_XDECREF(__pyx_v_sec);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_opt);
  __Pyx_XDECREF(__pyx_v_config);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":989
 *     return config
 * 
 * def checkIndex(val, minincluded, maxexcluded):             # <<<<<<<<<<<<<<
 *     assert(minincluded <= val < maxexcluded)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_97checkIndex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_97checkIndex = {"checkIndex", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_97checkIndex, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_97checkIndex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_minincluded = 0;
  PyObject *__pyx_v_maxexcluded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checkIndex (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_minincluded,&__pyx_n_s_maxexcluded,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minincluded)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("checkIndex", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxexcluded)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("checkIndex", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "checkIndex") < 0)) __PYX_ERR(0, 989, __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_val = values[0];
    __pyx_v_minincluded = values[1];
    __pyx_v_maxexcluded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("checkIndex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.checkIndex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_96checkIndex(__pyx_self, __pyx_v_val, __pyx_v_minincluded, __pyx_v_maxexcluded);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_96checkIndex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_minincluded, PyObject *__pyx_v_maxexcluded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("checkIndex", 0);

  /* "metaphor/monal/util/toolbox.py":990
 * 
 * def checkIndex(val, minincluded, maxexcluded):
 *     assert(minincluded <= val < maxexcluded)             # <<<<<<<<<<<<<<
 * 
 * def listorstr(cible, sep=';'):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_minincluded, __pyx_v_val, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_maxexcluded, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 990, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 990, __pyx_L1_error)
    }
  }
  #endif

  /* "metaphor/monal/util/toolbox.py":989
 *     return config
 * 
 * def checkIndex(val, minincluded, maxexcluded):             # <<<<<<<<<<<<<<
 *     assert(minincluded <= val < maxexcluded)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.checkIndex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":992
 *     assert(minincluded <= val < maxexcluded)
 * 
 * def listorstr(cible, sep=';'):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, str):
 *         return cible.split(sep)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_99listorstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_99listorstr = {"listorstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_99listorstr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_99listorstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cible = 0;
  PyObject *__pyx_v_sep = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("listorstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cible,&__pyx_n_s_sep,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u__35));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cible)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sep);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "listorstr") < 0)) __PYX_ERR(0, 992, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cible = values[0];
    __pyx_v_sep = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("listorstr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.listorstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_98listorstr(__pyx_self, __pyx_v_cible, __pyx_v_sep);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_98listorstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cible, PyObject *__pyx_v_sep) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("listorstr", 0);

  /* "metaphor/monal/util/toolbox.py":993
 * 
 * def listorstr(cible, sep=';'):
 *     if isinstance(cible, str):             # <<<<<<<<<<<<<<
 *         return cible.split(sep)
 *     return str(cible)
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_cible); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":994
 * def listorstr(cible, sep=';'):
 *     if isinstance(cible, str):
 *         return cible.split(sep)             # <<<<<<<<<<<<<<
 *     return str(cible)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cible, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_sep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_sep};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_sep};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 994, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_sep);
        __Pyx_GIVEREF(__pyx_v_sep);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_sep);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":993
 * 
 * def listorstr(cible, sep=';'):
 *     if isinstance(cible, str):             # <<<<<<<<<<<<<<
 *         return cible.split(sep)
 *     return str(cible)
 */
  }

  /* "metaphor/monal/util/toolbox.py":995
 *     if isinstance(cible, str):
 *         return cible.split(sep)
 *     return str(cible)             # <<<<<<<<<<<<<<
 * 
 * def listorint(cible):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_cible); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":992
 *     assert(minincluded <= val < maxexcluded)
 * 
 * def listorstr(cible, sep=';'):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, str):
 *         return cible.split(sep)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.listorstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":997
 *     return str(cible)
 * 
 * def listorint(cible):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, int):
 *         return [cible]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_101listorint(PyObject *__pyx_self, PyObject *__pyx_v_cible); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_101listorint = {"listorint", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_101listorint, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_101listorint(PyObject *__pyx_self, PyObject *__pyx_v_cible) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("listorint (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_100listorint(__pyx_self, ((PyObject *)__pyx_v_cible));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_100listorint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cible) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("listorint", 0);

  /* "metaphor/monal/util/toolbox.py":998
 * 
 * def listorint(cible):
 *     if isinstance(cible, int):             # <<<<<<<<<<<<<<
 *         return [cible]
 *     return cible
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_cible); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":999
 * def listorint(cible):
 *     if isinstance(cible, int):
 *         return [cible]             # <<<<<<<<<<<<<<
 *     return cible
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_cible);
    __Pyx_GIVEREF(__pyx_v_cible);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_cible);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":998
 * 
 * def listorint(cible):
 *     if isinstance(cible, int):             # <<<<<<<<<<<<<<
 *         return [cible]
 *     return cible
 */
  }

  /* "metaphor/monal/util/toolbox.py":1000
 *     if isinstance(cible, int):
 *         return [cible]
 *     return cible             # <<<<<<<<<<<<<<
 * 
 * def shiftText(text, shft):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cible);
  __pyx_r = __pyx_v_cible;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":997
 *     return str(cible)
 * 
 * def listorint(cible):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, int):
 *         return [cible]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.listorint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1002
 *     return cible
 * 
 * def shiftText(text, shft):             # <<<<<<<<<<<<<<
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_103shiftText(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_103shiftText = {"shiftText", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_103shiftText, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_103shiftText(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_text = 0;
  PyObject *__pyx_v_shft = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shiftText (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_shft,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shft)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("shiftText", 1, 2, 2, 1); __PYX_ERR(0, 1002, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shiftText") < 0)) __PYX_ERR(0, 1002, __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_text = values[0];
    __pyx_v_shft = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shiftText", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1002, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.shiftText", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_102shiftText(__pyx_self, __pyx_v_text, __pyx_v_shft);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_102shiftText(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_shft) {
  PyObject *__pyx_8genexpr3__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannySetupContext("shiftText", 0);

  /* "metaphor/monal/util/toolbox.py":1003
 * 
 * def shiftText(text, shft):
 *     return '\n'.join([shft + st for st in text.splitlines()])             # <<<<<<<<<<<<<<
 * 
 * def dothread(func):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_splitlines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1003, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1003, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1003, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_st, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_shft, __pyx_8genexpr3__pyx_v_st); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1003, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_st); __pyx_8genexpr3__pyx_v_st = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_st); __pyx_8genexpr3__pyx_v_st = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__20, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1002
 *     return cible
 * 
 * def shiftText(text, shft):             # <<<<<<<<<<<<<<
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 */

  /* function 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("metaphor.monal.util.toolbox.shiftText", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_105dothread(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_105dothread = {"dothread", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_105dothread, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_105dothread(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dothread (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_104dothread(__pyx_self, ((PyObject *)__pyx_v_func));

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

/* "metaphor/monal/util/toolbox.py":1008
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):             # <<<<<<<<<<<<<<
 *         t = threading.Thread(target=func, args=args)
 *         t.start()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8dothread_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_8dothread_1wrapper = {"wrapper", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_8dothread_1wrapper, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8dothread_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_8dothread_wrapper(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8dothread_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *__pyx_outer_scope;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("wrapper", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":1009
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):
 *         t = threading.Thread(target=func, args=args)             # <<<<<<<<<<<<<<
 *         t.start()
 *     return wrapper
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_threading)) { __Pyx_RaiseClosureNameError("threading"); __PYX_ERR(0, 1009, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_threading, __pyx_n_s_Thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 1009, __pyx_L1_error) }
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_cur_scope->__pyx_v_func) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_v_args) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_t = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1010
 *     def wrapper(*args):
 *         t = threading.Thread(target=func, args=args)
 *         t.start()             # <<<<<<<<<<<<<<
 *     return wrapper
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1008
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):             # <<<<<<<<<<<<<<
 *         t = threading.Thread(target=func, args=args)
 *         t.start()
 */

  /* 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("metaphor.monal.util.toolbox.dothread.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_104dothread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *__pyx_cur_scope;
  PyObject *__pyx_v_wrapper = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("dothread", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1005, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);

  /* "metaphor/monal/util/toolbox.py":1006
 * 
 * def dothread(func):
 *     import threading             # <<<<<<<<<<<<<<
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_threading = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1008
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):             # <<<<<<<<<<<<<<
 *         t = threading.Thread(target=func, args=args)
 *         t.start()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_8dothread_1wrapper, 0, __pyx_n_s_dothread_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrapper = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1011
 *         t = threading.Thread(target=func, args=args)
 *         t.start()
 *     return wrapper             # <<<<<<<<<<<<<<
 * 
 * def fileexists(path):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrapper);
  __pyx_r = __pyx_v_wrapper;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.dothread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrapper);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1013
 *     return wrapper
 * 
 * def fileexists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_107fileexists(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_107fileexists = {"fileexists", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_107fileexists, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_107fileexists(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileexists (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_106fileexists(__pyx_self, ((PyObject *)__pyx_v_path));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_106fileexists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("fileexists", 0);

  /* "metaphor/monal/util/toolbox.py":1014
 * 
 * def fileexists(path):
 *     if isinstance(path, str):             # <<<<<<<<<<<<<<
 *         return os.path.isfile(path)  #and os.path.exists(path)
 *     for val in path:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_path); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":1015
 * def fileexists(path):
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)             # <<<<<<<<<<<<<<
 *     for val in path:
 *         if not os.path.isfile(val): return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_path);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1014
 * 
 * def fileexists(path):
 *     if isinstance(path, str):             # <<<<<<<<<<<<<<
 *         return os.path.isfile(path)  #and os.path.exists(path)
 *     for val in path:
 */
  }

  /* "metaphor/monal/util/toolbox.py":1016
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 *     for val in path:             # <<<<<<<<<<<<<<
 *         if not os.path.isfile(val): return False
 *     return True
 */
  if (likely(PyList_CheckExact(__pyx_v_path)) || PyTuple_CheckExact(__pyx_v_path)) {
    __pyx_t_3 = __pyx_v_path; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1016, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1017
 *         return os.path.isfile(path)  #and os.path.exists(path)
 *     for val in path:
 *         if not os.path.isfile(val): return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_val};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_val};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":1016
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 *     for val in path:             # <<<<<<<<<<<<<<
 *         if not os.path.isfile(val): return False
 *     return True
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1018
 *     for val in path:
 *         if not os.path.isfile(val): return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def direxists(path):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1013
 *     return wrapper
 * 
 * def fileexists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 */

  /* 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_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.fileexists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1020
 *     return True
 * 
 * def direxists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_109direxists(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_109direxists = {"direxists", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_109direxists, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_109direxists(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("direxists (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_108direxists(__pyx_self, ((PyObject *)__pyx_v_path));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_108direxists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("direxists", 0);

  /* "metaphor/monal/util/toolbox.py":1021
 * 
 * def direxists(path):
 *     if isinstance(path, str):             # <<<<<<<<<<<<<<
 *         return os.path.isdir(path)  #and os.path.exists(path)
 *     for val in path:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_path); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":1022
 * def direxists(path):
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)             # <<<<<<<<<<<<<<
 *     for val in path:
 *         if not os.path.isdir(val): return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_path};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1022, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_path);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1021
 * 
 * def direxists(path):
 *     if isinstance(path, str):             # <<<<<<<<<<<<<<
 *         return os.path.isdir(path)  #and os.path.exists(path)
 *     for val in path:
 */
  }

  /* "metaphor/monal/util/toolbox.py":1023
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 *     for val in path:             # <<<<<<<<<<<<<<
 *         if not os.path.isdir(val): return False
 *     return True
 */
  if (likely(PyList_CheckExact(__pyx_v_path)) || PyTuple_CheckExact(__pyx_v_path)) {
    __pyx_t_3 = __pyx_v_path; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1023, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1023, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1023, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1024
 *         return os.path.isdir(path)  #and os.path.exists(path)
 *     for val in path:
 *         if not os.path.isdir(val): return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_val};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_val};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":1023
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 *     for val in path:             # <<<<<<<<<<<<<<
 *         if not os.path.isdir(val): return False
 *     return True
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1025
 *     for val in path:
 *         if not os.path.isdir(val): return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def checkFile(path, full=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1020
 *     return True
 * 
 * def direxists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 */

  /* 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_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.direxists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1027
 *     return True
 * 
 * def checkFile(path, full=False):             # <<<<<<<<<<<<<<
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_111checkFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_111checkFile = {"checkFile", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_111checkFile, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_111checkFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checkFile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_full,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "checkFile") < 0)) __PYX_ERR(0, 1027, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_full = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("checkFile", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1027, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.checkFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_110checkFile(__pyx_self, __pyx_v_path, __pyx_v_full);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_110checkFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_full) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("checkFile", 0);

  /* "metaphor/monal/util/toolbox.py":1028
 * 
 * def checkFile(path, full=False):
 *     res = os.path.isfile(path)             # <<<<<<<<<<<<<<
 *     if full: assert res ("file %s does not exists" % path)
 *     return res
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_path);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1029
 * def checkFile(path, full=False):
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)             # <<<<<<<<<<<<<<
 *     return res
 * CheckFile = checkFile
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  if (__pyx_t_5) {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_file_s_does_not_exists, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_res);
      __pyx_t_4 = __pyx_v_res; __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 1029, __pyx_L1_error)
      }
    }
    #endif
  }

  /* "metaphor/monal/util/toolbox.py":1030
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)
 *     return res             # <<<<<<<<<<<<<<
 * CheckFile = checkFile
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1027
 *     return True
 * 
 * def checkFile(path, full=False):             # <<<<<<<<<<<<<<
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.checkFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1033
 * CheckFile = checkFile
 * 
 * def fullFileName(value, chemin):             # <<<<<<<<<<<<<<
 *     if (chemin == '') or (value == ''):
 *         return value
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_113fullFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_113fullFileName = {"fullFileName", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_113fullFileName, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_113fullFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_chemin = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fullFileName (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_chemin,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chemin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fullFileName", 1, 2, 2, 1); __PYX_ERR(0, 1033, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fullFileName") < 0)) __PYX_ERR(0, 1033, __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_value = values[0];
    __pyx_v_chemin = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fullFileName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1033, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.fullFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_112fullFileName(__pyx_self, __pyx_v_value, __pyx_v_chemin);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_112fullFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_chemin) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("fullFileName", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "metaphor/monal/util/toolbox.py":1034
 * 
 * def fullFileName(value, chemin):
 *     if (chemin == '') or (value == ''):             # <<<<<<<<<<<<<<
 *         return value
 *     else:
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_chemin, __pyx_kp_u__17, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_kp_u__17, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":1035
 * def fullFileName(value, chemin):
 *     if (chemin == '') or (value == ''):
 *         return value             # <<<<<<<<<<<<<<
 *     else:
 *         res = os.path.split(value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1034
 * 
 * def fullFileName(value, chemin):
 *     if (chemin == '') or (value == ''):             # <<<<<<<<<<<<<<
 *         return value
 *     else:
 */
  }

  /* "metaphor/monal/util/toolbox.py":1037
 *         return value
 *     else:
 *         res = os.path.split(value)             # <<<<<<<<<<<<<<
 *         if res[0] != '':
 *             value = res[1]
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_value};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_value};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1037, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_value);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_res = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":1038
 *     else:
 *         res = os.path.split(value)
 *         if res[0] != '':             # <<<<<<<<<<<<<<
 *             value = res[1]
 *         return os.path.join(chemin, value)
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__17, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "metaphor/monal/util/toolbox.py":1039
 *         res = os.path.split(value)
 *         if res[0] != '':
 *             value = res[1]             # <<<<<<<<<<<<<<
 *         return os.path.join(chemin, value)
 * FullFileName = fullFileName
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_res, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":1038
 *     else:
 *         res = os.path.split(value)
 *         if res[0] != '':             # <<<<<<<<<<<<<<
 *             value = res[1]
 *         return os.path.join(chemin, value)
 */
    }

    /* "metaphor/monal/util/toolbox.py":1040
 *         if res[0] != '':
 *             value = res[1]
 *         return os.path.join(chemin, value)             # <<<<<<<<<<<<<<
 * FullFileName = fullFileName
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_chemin, __pyx_v_value};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_chemin, __pyx_v_value};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1040, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_chemin);
      __Pyx_GIVEREF(__pyx_v_chemin);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_chemin);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __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_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1033
 * CheckFile = checkFile
 * 
 * def fullFileName(value, chemin):             # <<<<<<<<<<<<<<
 *     if (chemin == '') or (value == ''):
 *         return value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.fullFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1187
 * # DateTimeToStr = dateTimeToStr
 * 
 * def addToFileName(filename, addstr):             # <<<<<<<<<<<<<<
 *     name, ext = os.path.split(filename)
 *     return "%s%s%s" %(name, addstr, ext)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_115addToFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_115addToFileName = {"addToFileName", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_115addToFileName, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_115addToFileName(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_addstr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addToFileName (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_addstr,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addstr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("addToFileName", 1, 2, 2, 1); __PYX_ERR(0, 1187, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addToFileName") < 0)) __PYX_ERR(0, 1187, __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_addstr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addToFileName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1187, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.addToFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_114addToFileName(__pyx_self, __pyx_v_filename, __pyx_v_addstr);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_114addToFileName(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_addstr) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_ext = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  __Pyx_RefNannySetupContext("addToFileName", 0);

  /* "metaphor/monal/util/toolbox.py":1188
 * 
 * def addToFileName(filename, addstr):
 *     name, ext = os.path.split(filename)             # <<<<<<<<<<<<<<
 *     return "%s%s%s" %(name, addstr, ext)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1188, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1188, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_name = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ext = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":1189
 * def addToFileName(filename, addstr):
 *     name, ext = os.path.split(filename)
 *     return "%s%s%s" %(name, addstr, ext)             # <<<<<<<<<<<<<<
 * 
 * def regFile(source, ext):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_addstr), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_ext), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1187
 * # DateTimeToStr = dateTimeToStr
 * 
 * def addToFileName(filename, addstr):             # <<<<<<<<<<<<<<
 *     name, ext = os.path.split(filename)
 *     return "%s%s%s" %(name, addstr, ext)
 */

  /* function 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("metaphor.monal.util.toolbox.addToFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_ext);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1191
 *     return "%s%s%s" %(name, addstr, ext)
 * 
 * def regFile(source, ext):             # <<<<<<<<<<<<<<
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_117regFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_117regFile = {"regFile", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_117regFile, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_117regFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("regFile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_ext,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ext)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("regFile", 1, 2, 2, 1); __PYX_ERR(0, 1191, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "regFile") < 0)) __PYX_ERR(0, 1191, __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_source = values[0];
    __pyx_v_ext = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("regFile", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1191, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.regFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_116regFile(__pyx_self, __pyx_v_source, __pyx_v_ext);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_116regFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_ext) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("regFile", 0);

  /* "metaphor/monal/util/toolbox.py":1192
 * 
 * def regFile(source, ext):
 *     n = source.rfind('.')             # <<<<<<<<<<<<<<
 *     if (n > 0): return source[:n] + '_R' + ext
 *     return source + '_R' + ext
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_rfind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1193
 * def regFile(source, ext):
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext             # <<<<<<<<<<<<<<
 *     return source + '_R' + ext
 * RegFile = regFile
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_source, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_n_u_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_ext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1194
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext
 *     return source + '_R' + ext             # <<<<<<<<<<<<<<
 * RegFile = regFile
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyNumber_Add(__pyx_v_source, __pyx_n_u_R); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1191
 *     return "%s%s%s" %(name, addstr, ext)
 * 
 * def regFile(source, ext):             # <<<<<<<<<<<<<<
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.regFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1218
 * # NouvelleListe = nouvelleListe = NewList = newList
 * 
 * def ContainsAny(seq, aset):             # <<<<<<<<<<<<<<
 *     for c in seq:
 *         if c in aset:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_119ContainsAny(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_119ContainsAny = {"ContainsAny", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_119ContainsAny, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_119ContainsAny(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_aset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ContainsAny (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_aset,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ContainsAny", 1, 2, 2, 1); __PYX_ERR(0, 1218, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ContainsAny") < 0)) __PYX_ERR(0, 1218, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_seq = values[0];
    __pyx_v_aset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ContainsAny", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1218, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.ContainsAny", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_118ContainsAny(__pyx_self, __pyx_v_seq, __pyx_v_aset);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_118ContainsAny(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_aset) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("ContainsAny", 0);

  /* "metaphor/monal/util/toolbox.py":1219
 * 
 * def ContainsAny(seq, aset):
 *     for c in seq:             # <<<<<<<<<<<<<<
 *         if c in aset:
 *             return True
 */
  if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) {
    __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1219, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1219, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1219, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1220
 * def ContainsAny(seq, aset):
 *     for c in seq:
 *         if c in aset:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_c, __pyx_v_aset, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1220, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "metaphor/monal/util/toolbox.py":1221
 *     for c in seq:
 *         if c in aset:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "metaphor/monal/util/toolbox.py":1220
 * def ContainsAny(seq, aset):
 *     for c in seq:
 *         if c in aset:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    }

    /* "metaphor/monal/util/toolbox.py":1219
 * 
 * def ContainsAny(seq, aset):
 *     for c in seq:             # <<<<<<<<<<<<<<
 *         if c in aset:
 *             return True
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1222
 *         if c in aset:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * def selectedData(data, select, default=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1218
 * # NouvelleListe = nouvelleListe = NewList = newList
 * 
 * def ContainsAny(seq, aset):             # <<<<<<<<<<<<<<
 *     for c in seq:
 *         if c in aset:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.ContainsAny", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1224
 *     return False
 * 
 * def selectedData(data, select, default=None):             # <<<<<<<<<<<<<<
 *     if select: return data
 *     return default
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_121selectedData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_121selectedData = {"selectedData", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_121selectedData, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_121selectedData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_select = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("selectedData (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_select,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("selectedData", 0, 2, 3, 1); __PYX_ERR(0, 1224, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selectedData") < 0)) __PYX_ERR(0, 1224, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_select = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("selectedData", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.selectedData", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_120selectedData(__pyx_self, __pyx_v_data, __pyx_v_select, __pyx_v_default);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_120selectedData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_select, PyObject *__pyx_v_default) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("selectedData", 0);

  /* "metaphor/monal/util/toolbox.py":1225
 * 
 * def selectedData(data, select, default=None):
 *     if select: return data             # <<<<<<<<<<<<<<
 *     return default
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_select); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1225, __pyx_L1_error)
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_data);
    __pyx_r = __pyx_v_data;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1226
 * def selectedData(data, select, default=None):
 *     if select: return data
 *     return default             # <<<<<<<<<<<<<<
 * 
 * def hasBoolValue(llist, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_default);
  __pyx_r = __pyx_v_default;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1224
 *     return False
 * 
 * def selectedData(data, select, default=None):             # <<<<<<<<<<<<<<
 *     if select: return data
 *     return default
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.selectedData", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1228
 *     return default
 * 
 * def hasBoolValue(llist, value):             # <<<<<<<<<<<<<<
 *     for tt in llist:
 *         if not tt ^ value: return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_123hasBoolValue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_123hasBoolValue = {"hasBoolValue", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_123hasBoolValue, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_123hasBoolValue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_llist = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hasBoolValue (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_llist,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_llist)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("hasBoolValue", 1, 2, 2, 1); __PYX_ERR(0, 1228, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasBoolValue") < 0)) __PYX_ERR(0, 1228, __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_llist = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasBoolValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1228, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.hasBoolValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_122hasBoolValue(__pyx_self, __pyx_v_llist, __pyx_v_value);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_122hasBoolValue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_llist, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_tt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("hasBoolValue", 0);

  /* "metaphor/monal/util/toolbox.py":1229
 * 
 * def hasBoolValue(llist, value):
 *     for tt in llist:             # <<<<<<<<<<<<<<
 *         if not tt ^ value: return True
 *     return False
 */
  if (likely(PyList_CheckExact(__pyx_v_llist)) || PyTuple_CheckExact(__pyx_v_llist)) {
    __pyx_t_1 = __pyx_v_llist; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_llist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1229, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tt, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1230
 * def hasBoolValue(llist, value):
 *     for tt in llist:
 *         if not tt ^ value: return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
    __pyx_t_4 = PyNumber_Xor(__pyx_v_tt, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "metaphor/monal/util/toolbox.py":1229
 * 
 * def hasBoolValue(llist, value):
 *     for tt in llist:             # <<<<<<<<<<<<<<
 *         if not tt ^ value: return True
 *     return False
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1231
 *     for tt in llist:
 *         if not tt ^ value: return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1228
 *     return default
 * 
 * def hasBoolValue(llist, value):             # <<<<<<<<<<<<<<
 *     for tt in llist:
 *         if not tt ^ value: return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.hasBoolValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1233
 *     return False
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):             # <<<<<<<<<<<<<<
 *     try:
 *         time.strptime(timestr, fmt)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_125IsValidHour(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_125IsValidHour = {"IsValidHour", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_125IsValidHour, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_125IsValidHour(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_timestr = 0;
  PyObject *__pyx_v_fmt = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("IsValidHour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timestr,&__pyx_n_s_fmt,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u_H_M));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fmt);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "IsValidHour") < 0)) __PYX_ERR(0, 1233, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_timestr = values[0];
    __pyx_v_fmt = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("IsValidHour", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1233, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.IsValidHour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_124IsValidHour(__pyx_self, __pyx_v_timestr, __pyx_v_fmt);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_124IsValidHour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_timestr, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("IsValidHour", 0);

  /* "metaphor/monal/util/toolbox.py":1234
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):
 *     try:             # <<<<<<<<<<<<<<
 *         time.strptime(timestr, fmt)
 *         return True
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":1235
 * def IsValidHour(timestr, fmt="%H:%M"):
 *     try:
 *         time.strptime(timestr, fmt)             # <<<<<<<<<<<<<<
 *         return True
 *     except:
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strptime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1235, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_timestr, __pyx_v_fmt};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_timestr, __pyx_v_fmt};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_timestr);
        __Pyx_GIVEREF(__pyx_v_timestr);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_timestr);
        __Pyx_INCREF(__pyx_v_fmt);
        __Pyx_GIVEREF(__pyx_v_fmt);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_fmt);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":1236
 *     try:
 *         time.strptime(timestr, fmt)
 *         return True             # <<<<<<<<<<<<<<
 *     except:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":1234
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):
 *     try:             # <<<<<<<<<<<<<<
 *         time.strptime(timestr, fmt)
 *         return True
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1237
 *         time.strptime(timestr, fmt)
 *         return True
 *     except:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.IsValidHour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1237, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "metaphor/monal/util/toolbox.py":1238
 *         return True
 *     except:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * # def findex(value, func, default=None):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":1234
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):
 *     try:             # <<<<<<<<<<<<<<
 *         time.strptime(timestr, fmt)
 *         return True
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1233
 *     return False
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):             # <<<<<<<<<<<<<<
 *     try:
 *         time.strptime(timestr, fmt)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.IsValidHour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1291
 * #         return data
 * 
 * def isiterable(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str): return False
 *     try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_127isiterable(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_127isiterable = {"isiterable", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_127isiterable, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_127isiterable(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isiterable (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_126isiterable(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_126isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("isiterable", 0);

  /* "metaphor/monal/util/toolbox.py":1292
 * 
 * def isiterable(value):
 *     if isinstance(value, str): return False             # <<<<<<<<<<<<<<
 *     try:
 *         iter(value)
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_value); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1293
 * def isiterable(value):
 *     if isinstance(value, str): return False
 *     try:             # <<<<<<<<<<<<<<
 *         iter(value)
 *         return True
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":1294
 *     if isinstance(value, str): return False
 *     try:
 *         iter(value)             # <<<<<<<<<<<<<<
 *         return True
 *     except TypeError:
 */
      __pyx_t_6 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/monal/util/toolbox.py":1295
 *     try:
 *         iter(value)
 *         return True             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L8_try_return;

      /* "metaphor/monal/util/toolbox.py":1293
 * def isiterable(value):
 *     if isinstance(value, str): return False
 *     try:             # <<<<<<<<<<<<<<
 *         iter(value)
 *         return True
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/monal/util/toolbox.py":1296
 *         iter(value)
 *         return True
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1296, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);

      /* "metaphor/monal/util/toolbox.py":1297
 *         return True
 *     except TypeError:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def stlen(value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L7_except_return;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "metaphor/monal/util/toolbox.py":1293
 * def isiterable(value):
 *     if isinstance(value, str): return False
 *     try:             # <<<<<<<<<<<<<<
 *         iter(value)
 *         return True
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1291
 * #         return data
 * 
 * def isiterable(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str): return False
 *     try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1299
 *         return False
 * 
 * def stlen(value):             # <<<<<<<<<<<<<<
 *     return value, len(value)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_129stlen(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_129stlen = {"stlen", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_129stlen, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_129stlen(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stlen (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_128stlen(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_128stlen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("stlen", 0);

  /* "metaphor/monal/util/toolbox.py":1300
 * 
 * def stlen(value):
 *     return value, len(value)             # <<<<<<<<<<<<<<
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1300, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1299
 *         return False
 * 
 * def stlen(value):             # <<<<<<<<<<<<<<
 *     return value, len(value)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.stlen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_131joinEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_131joinEx = {"joinEx", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_131joinEx, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_131joinEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sep = 0;
  PyObject *__pyx_v_iterator = 0;
  PyObject *__pyx_v_limited = 0;
  PyObject *__pyx_v_fillchar = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("joinEx (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sep,&__pyx_n_s_iterator,&__pyx_n_s_limited,&__pyx_n_s_fillchar,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject*)__pyx_kp_u__58));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sep)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterator)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("joinEx", 0, 2, 4, 1); __PYX_ERR(0, 1302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_limited);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fillchar);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "joinEx") < 0)) __PYX_ERR(0, 1302, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sep = values[0];
    __pyx_v_iterator = values[1];
    __pyx_v_limited = values[2];
    __pyx_v_fillchar = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("joinEx", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_130joinEx(__pyx_self, __pyx_v_sep, __pyx_v_iterator, __pyx_v_limited, __pyx_v_fillchar);

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

/* "metaphor/monal/util/toolbox.py":1303
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 *     def modifiedstr(value, sep, lim):             # <<<<<<<<<<<<<<
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_6joinEx_1modifiedstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_6joinEx_1modifiedstr = {"modifiedstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_6joinEx_1modifiedstr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_6joinEx_1modifiedstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_sep = 0;
  PyObject *__pyx_v_lim = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("modifiedstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_sep,&__pyx_n_s_lim,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sep)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("modifiedstr", 1, 3, 3, 1); __PYX_ERR(0, 1303, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("modifiedstr", 1, 3, 3, 2); __PYX_ERR(0, 1303, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "modifiedstr") < 0)) __PYX_ERR(0, 1303, __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_value = values[0];
    __pyx_v_sep = values[1];
    __pyx_v_lim = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("modifiedstr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1303, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx.modifiedstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_modifiedstr(__pyx_self, __pyx_v_value, __pyx_v_sep, __pyx_v_lim);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_modifiedstr(PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sep, PyObject *__pyx_v_lim) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_outer_scope;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("modifiedstr", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "metaphor/monal/util/toolbox.py":1304
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)             # <<<<<<<<<<<<<<
 *         if lim: return st[:sep]
 *         return st
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ljust); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_fillchar)) { __Pyx_RaiseClosureNameError("fillchar"); __PYX_ERR(0, 1304, __pyx_L1_error) }
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_sep, __pyx_cur_scope->__pyx_v_fillchar};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_sep, __pyx_cur_scope->__pyx_v_fillchar};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sep);
    __Pyx_GIVEREF(__pyx_v_sep);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_sep);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fillchar);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fillchar);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_fillchar);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_st = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1305
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]             # <<<<<<<<<<<<<<
 *         return st
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_lim); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1305, __pyx_L1_error)
  if (__pyx_t_6) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_st, 0, 0, NULL, &__pyx_v_sep, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1306
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]
 *         return st             # <<<<<<<<<<<<<<
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_st);
  __pyx_r = __pyx_v_st;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1303
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 *     def modifiedstr(value, sep, lim):             # <<<<<<<<<<<<<<
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx.modifiedstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_6joinEx_4generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1309
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides
 *         return sep.join(val for val in iterator if val)             # <<<<<<<<<<<<<<
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_2genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1309, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_6joinEx_4generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_joinEx_locals_genexpr, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1309, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx.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_8metaphor_5monal_4util_7toolbox_6joinEx_4generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *)__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;
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1309, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) { __Pyx_RaiseClosureNameError("iterator"); __PYX_ERR(0, 1309, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_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_outer_scope->__pyx_v_iterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1309, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_val); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1309, __pyx_L1_error)
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val);
      __pyx_r = __pyx_cur_scope->__pyx_v_val;
      __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();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_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_ERR(0, 1309, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/monal/util/toolbox.py":1312
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)             # <<<<<<<<<<<<<<
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_5genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1312, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_6joinEx_7generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_joinEx_locals_genexpr, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1312, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx.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_8metaphor_5monal_4util_7toolbox_6joinEx_7generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)__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;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) { __Pyx_RaiseClosureNameError("iterator"); __PYX_ERR(0, 1312, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_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_outer_scope->__pyx_v_iterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1312, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1312, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1312, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep)) { __Pyx_RaiseClosureNameError("sep"); __PYX_ERR(0, 1312, __pyx_L1_error) }
    __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep;
    __Pyx_INCREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_limited)) { __Pyx_RaiseClosureNameError("limited"); __PYX_ERR(0, 1312, __pyx_L1_error) }
    __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_limited;
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_modifiedstr)) { __Pyx_RaiseClosureNameError("modifiedstr"); __PYX_ERR(0, 1312, __pyx_L1_error) }
    __pyx_t_6 = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_modifiedstr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_modifiedstr, __pyx_cur_scope->__pyx_v_val, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1312, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_6joinEx_10generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1314
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))             # <<<<<<<<<<<<<<
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_8genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1314, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_6joinEx_10generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_joinEx_locals_genexpr, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx.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_8metaphor_5monal_4util_7toolbox_6joinEx_10generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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 *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep)) { __Pyx_RaiseClosureNameError("sep"); __PYX_ERR(0, 1314, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator)) { __Pyx_RaiseClosureNameError("iterator"); __PYX_ERR(0, 1314, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_sep);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_iterator);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1314, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1314, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1314, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1314, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1314, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sepl);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sepl, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_limited)) { __Pyx_RaiseClosureNameError("limited"); __PYX_ERR(0, 1314, __pyx_L1_error) }
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_limited;
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_modifiedstr)) { __Pyx_RaiseClosureNameError("modifiedstr"); __PYX_ERR(0, 1314, __pyx_L1_error) }
    __pyx_t_6 = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_modifiedstr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_modifiedstr, __pyx_cur_scope->__pyx_v_val, __pyx_cur_scope->__pyx_v_sepl, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_130joinEx(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sep, PyObject *__pyx_v_iterator, PyObject *__pyx_v_limited, PyObject *__pyx_v_fillchar) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("joinEx", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1302, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_sep = __pyx_v_sep;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sep);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sep);
  __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_cur_scope->__pyx_v_limited = __pyx_v_limited;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_limited);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_limited);
  __pyx_cur_scope->__pyx_v_fillchar = __pyx_v_fillchar;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fillchar);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fillchar);

  /* "metaphor/monal/util/toolbox.py":1303
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 *     def modifiedstr(value, sep, lim):             # <<<<<<<<<<<<<<
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_6joinEx_1modifiedstr, 0, __pyx_n_s_joinEx_locals_modifiedstr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_modifiedstr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1308
 *         return st
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides             # <<<<<<<<<<<<<<
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":1309
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides
 *         return sep.join(val for val in iterator if val)             # <<<<<<<<<<<<<<
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sep, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1309, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1309, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1309, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/monal/util/toolbox.py":1308
 *         return st
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides             # <<<<<<<<<<<<<<
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1310
 *     try:  # si sep est un string, on fait le joint en eliminant les vides
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides             # <<<<<<<<<<<<<<
 *         if isinstance(sep, int):
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 1310, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);

      /* "metaphor/monal/util/toolbox.py":1311
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):             # <<<<<<<<<<<<<<
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 */
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_sep;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_9 = PyInt_Check(__pyx_t_6); 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (__pyx_t_10) {

        /* "metaphor/monal/util/toolbox.py":1312
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)             # <<<<<<<<<<<<<<
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_5genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__17, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_except_return;

        /* "metaphor/monal/util/toolbox.py":1311
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 *         if isinstance(sep, int):             # <<<<<<<<<<<<<<
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 */
      }

      /* "metaphor/monal/util/toolbox.py":1314
 *             return ''.join(modifiedstr(val, sep, limited) for val in iterator)
 *         else:  #si sep est une liste d'entiers, on applique chaque sep au champ correspondant
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))             # <<<<<<<<<<<<<<
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __pyx_pf_8metaphor_5monal_4util_7toolbox_6joinEx_8genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1314, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__17, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1314, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_except_return;
      }
    }
    __pyx_L5_except_error:;

    /* "metaphor/monal/util/toolbox.py":1308
 *         return st
 * 
 *     try:  # si sep est un string, on fait le joint en eliminant les vides             # <<<<<<<<<<<<<<
 *         return sep.join(val for val in iterator if val)
 *     except:  # si sep est un entier, on aligne les champs en incluant les vides
 */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.joinEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1316
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):             # <<<<<<<<<<<<<<
 *     result = []
 *     for _ in range(nline):  #i
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_133createAleaTable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_133createAleaTable = {"createAleaTable", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_133createAleaTable, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_133createAleaTable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nline = 0;
  PyObject *__pyx_v_nperline = 0;
  PyObject *__pyx_v_absmax = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createAleaTable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nline,&__pyx_n_s_nperline,&__pyx_n_s_absmax,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)((PyObject *)__pyx_int_1));
    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
    values[2] = ((PyObject *)((PyObject*)__pyx_float_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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nline);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nperline);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_absmax);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAleaTable") < 0)) __PYX_ERR(0, 1316, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nline = values[0];
    __pyx_v_nperline = values[1];
    __pyx_v_absmax = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createAleaTable", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1316, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.createAleaTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_132createAleaTable(__pyx_self, __pyx_v_nline, __pyx_v_nperline, __pyx_v_absmax);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_132createAleaTable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nline, PyObject *__pyx_v_nperline, PyObject *__pyx_v_absmax) {
  PyObject *__pyx_v_result = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  CYTHON_UNUSED PyObject *__pyx_8genexpr7__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("createAleaTable", 0);

  /* "metaphor/monal/util/toolbox.py":1317
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 *     result = []             # <<<<<<<<<<<<<<
 *     for _ in range(nline):  #i
 *         result.append([(2*random.random() - 1) * absmax for _ in range(nperline)])
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1318
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 *     result = []
 *     for _ in range(nline):  #i             # <<<<<<<<<<<<<<
 *         result.append([(2*random.random() - 1) * absmax for _ in range(nperline)])
 *     return result
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_nline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1318, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1319
 *     result = []
 *     for _ in range(nline):  #i
 *         result.append([(2*random.random() - 1) * absmax for _ in range(nperline)])             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_nperline); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1319, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1319, __pyx_L7_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1319, __pyx_L7_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1319, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v__, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_random); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_random); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (__pyx_t_9) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else {
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Multiply(__pyx_t_5, __pyx_v_absmax); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1319, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v__); __pyx_8genexpr7__pyx_v__ = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v__); __pyx_8genexpr7__pyx_v__ = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1318
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):
 *     result = []
 *     for _ in range(nline):  #i             # <<<<<<<<<<<<<<
 *         result.append([(2*random.random() - 1) * absmax for _ in range(nperline)])
 *     return result
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1320
 *     for _ in range(nline):  #i
 *         result.append([(2*random.random() - 1) * absmax for _ in range(nperline)])
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def printnl(val, nl=1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1316
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):             # <<<<<<<<<<<<<<
 *     result = []
 *     for _ in range(nline):  #i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.createAleaTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1322
 *     return result
 * 
 * def printnl(val, nl=1):             # <<<<<<<<<<<<<<
 *     print((val + "\n"*nl))
 * #    for i in xrange(nl):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_135printnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_135printnl = {"printnl", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_135printnl, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_135printnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_nl = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("printnl (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_nl,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nl);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "printnl") < 0)) __PYX_ERR(0, 1322, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_val = values[0];
    __pyx_v_nl = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("printnl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1322, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.printnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_134printnl(__pyx_self, __pyx_v_val, __pyx_v_nl);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_134printnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_nl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("printnl", 0);

  /* "metaphor/monal/util/toolbox.py":1323
 * 
 * def printnl(val, nl=1):
 *     print((val + "\n"*nl))             # <<<<<<<<<<<<<<
 * #    for i in xrange(nl):
 * #        print
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_kp_u__20, __pyx_v_nl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_v_val, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __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;

  /* "metaphor/monal/util/toolbox.py":1322
 *     return result
 * 
 * def printnl(val, nl=1):             # <<<<<<<<<<<<<<
 *     print((val + "\n"*nl))
 * #    for i in xrange(nl):
 */

  /* 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_AddTraceback("metaphor.monal.util.toolbox.printnl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1327
 * #        print
 * 
 * def printdoc(obj):             # <<<<<<<<<<<<<<
 *     lst= dir(obj)
 *     for value in lst:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_137printdoc(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_137printdoc = {"printdoc", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_137printdoc, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_137printdoc(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("printdoc (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_136printdoc(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_136printdoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("printdoc", 0);

  /* "metaphor/monal/util/toolbox.py":1328
 * 
 * def printdoc(obj):
 *     lst= dir(obj)             # <<<<<<<<<<<<<<
 *     for value in lst:
 *         try:
 */
  __pyx_t_1 = PyObject_Dir(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1329
 * def printdoc(obj):
 *     lst= dir(obj)
 *     for value in lst:             # <<<<<<<<<<<<<<
 *         try:
 *             st = getattr(obj, value).__doc__
 */
  if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
    __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1329, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1329, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1329, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/monal/util/toolbox.py":1330
 *     lst= dir(obj)
 *     for value in lst:
 *         try:             # <<<<<<<<<<<<<<
 *             st = getattr(obj, value).__doc__
 *             print((value,'\t\t',st))
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "metaphor/monal/util/toolbox.py":1331
 *     for value in lst:
 *         try:
 *             st = getattr(obj, value).__doc__             # <<<<<<<<<<<<<<
 *             print((value,'\t\t',st))
 *         except:
 */
        __pyx_t_4 = __Pyx_GetAttr(__pyx_v_obj, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_doc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1331, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_st, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/monal/util/toolbox.py":1332
 *         try:
 *             st = getattr(obj, value).__doc__
 *             print((value,'\t\t',st))             # <<<<<<<<<<<<<<
 *         except:
 *             print(value)
 */
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_value);
        __Pyx_INCREF(__pyx_kp_u__66);
        __Pyx_GIVEREF(__pyx_kp_u__66);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u__66);
        __Pyx_INCREF(__pyx_v_st);
        __Pyx_GIVEREF(__pyx_v_st);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_st);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "metaphor/monal/util/toolbox.py":1330
 *     lst= dir(obj)
 *     for value in lst:
 *         try:             # <<<<<<<<<<<<<<
 *             st = getattr(obj, value).__doc__
 *             print((value,'\t\t',st))
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/monal/util/toolbox.py":1333
 *             st = getattr(obj, value).__doc__
 *             print((value,'\t\t',st))
 *         except:             # <<<<<<<<<<<<<<
 *             print(value)
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.monal.util.toolbox.printdoc", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1333, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "metaphor/monal/util/toolbox.py":1334
 *             print((value,'\t\t',st))
 *         except:
 *             print(value)             # <<<<<<<<<<<<<<
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):
 */
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1334, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;

      /* "metaphor/monal/util/toolbox.py":1330
 *     lst= dir(obj)
 *     for value in lst:
 *         try:             # <<<<<<<<<<<<<<
 *             st = getattr(obj, value).__doc__
 *             print((value,'\t\t',st))
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L12_try_end:;
    }

    /* "metaphor/monal/util/toolbox.py":1329
 * def printdoc(obj):
 *     lst= dir(obj)
 *     for value in lst:             # <<<<<<<<<<<<<<
 *         try:
 *             st = getattr(obj, value).__doc__
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1327
 * #        print
 * 
 * def printdoc(obj):             # <<<<<<<<<<<<<<
 *     lst= dir(obj)
 *     for value in lst:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.printdoc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_139PrettyPrintDic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_138PrettyPrintDic[] = "Bel imprimeur de distionnaire\n  - intro pr\303\203\302\257\303\202\302\277\303\202\305\223c\303\203\302\257\303\202\302\277\303\202\305\223de chaque ligne\n  - inter est plac\303\203\302\257\303\202\302\277\303\202\305\223 entre la cl\303\203\302\257\303\202\302\277\303\202\305\223 et la valeur\nLes cl\303\203\302\257\303\202\302\277\303\202\305\223s sont allong\303\203\302\257\303\202\302\277\303\202\305\223es align\303\203\302\257\303\202\302\277\303\202\305\223es sur la plus longue.";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_139PrettyPrintDic = {"PrettyPrintDic", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_139PrettyPrintDic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_5monal_4util_7toolbox_138PrettyPrintDic};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_139PrettyPrintDic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dic = 0;
  PyObject *__pyx_v_intro = 0;
  PyObject *__pyx_v_inter = 0;
  PyObject *__pyx_v_dico2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PrettyPrintDic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dic,&__pyx_n_s_intro,&__pyx_n_s_inter,&__pyx_n_s_dico2,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dic)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_intro)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("PrettyPrintDic", 0, 2, 4, 1); __PYX_ERR(0, 1336, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dico2);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PrettyPrintDic") < 0)) __PYX_ERR(0, 1336, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dic = values[0];
    __pyx_v_intro = values[1];
    __pyx_v_inter = values[2];
    __pyx_v_dico2 = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("PrettyPrintDic", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.PrettyPrintDic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_138PrettyPrintDic(__pyx_self, __pyx_v_dic, __pyx_v_intro, __pyx_v_inter, __pyx_v_dico2);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1341
 *   - inter est plac entre la cl et la valeur
 * Les cls sont allonges alignes sur la plus longue."""
 *     ll = max(len(key) for key in list(dic.keys()))             # <<<<<<<<<<<<<<
 *     for key, value in list(dic.items()):
 *         if dico2 is None:
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1341, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PrettyPrintDic_locals_genexpr, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.PrettyPrintDic.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_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_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;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1341, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dic)) { __Pyx_RaiseClosureNameError("dic"); __PYX_ERR(0, 1341, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dic, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1341, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_key); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1341, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1341, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* 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_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_138PrettyPrintDic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dic, PyObject *__pyx_v_intro, PyObject *__pyx_v_inter, PyObject *__pyx_v_dico2) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *__pyx_cur_scope;
  PyObject *__pyx_v_ll = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("PrettyPrintDic", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1336, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_dic = __pyx_v_dic;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dic);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dic);

  /* "metaphor/monal/util/toolbox.py":1341
 *   - inter est plac entre la cl et la valeur
 * Les cls sont allonges alignes sur la plus longue."""
 *     ll = max(len(key) for key in list(dic.keys()))             # <<<<<<<<<<<<<<
 *     for key, value in list(dic.items()):
 *         if dico2 is None:
 */
  __pyx_t_1 = __pyx_pf_8metaphor_5monal_4util_7toolbox_14PrettyPrintDic_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ll = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1342
 * Les cls sont allonges alignes sur la plus longue."""
 *     ll = max(len(key) for key in list(dic.keys()))
 *     for key, value in list(dic.items()):             # <<<<<<<<<<<<<<
 *         if dico2 is None:
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dic, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1342, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1342, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1342, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/monal/util/toolbox.py":1343
 *     ll = max(len(key) for key in list(dic.keys()))
 *     for key, value in list(dic.items()):
 *         if dico2 is None:             # <<<<<<<<<<<<<<
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))
 *         else:
 */
    __pyx_t_8 = (__pyx_v_dico2 == Py_None);
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (__pyx_t_9) {

      /* "metaphor/monal/util/toolbox.py":1344
 *     for key, value in list(dic.items()):
 *         if dico2 is None:
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))             # <<<<<<<<<<<<<<
 *         else:
 *             print(("%s%s%s\t%s%s %s" %(intro, key, blank(ll - len(key)), inter, value, dico2[key])))
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_intro), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1344, __pyx_L1_error)
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = PyNumber_Subtract(__pyx_v_ll, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_13};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_13};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1344, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__67);
      __pyx_t_10 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__67);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__67);
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_inter), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":1343
 *     ll = max(len(key) for key in list(dic.keys()))
 *     for key, value in list(dic.items()):
 *         if dico2 is None:             # <<<<<<<<<<<<<<
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))
 *         else:
 */
      goto __pyx_L7;
    }

    /* "metaphor/monal/util/toolbox.py":1346
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))
 *         else:
 *             print(("%s%s%s\t%s%s %s" %(intro, key, blank(ll - len(key)), inter, value, dico2[key])))             # <<<<<<<<<<<<<<
 * 
 * # def listEqual(lst1, lst2):
 */
    /*else*/ {
      __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_intro), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_blank); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1346, __pyx_L1_error)
      __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyNumber_Subtract(__pyx_v_ll, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_14) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_13};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_13};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __pyx_t_14 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__67);
      __pyx_t_10 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__67);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__67);
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_inter), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__58);
      __pyx_t_10 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__58);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__58);
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_dico2, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 8, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L7:;

    /* "metaphor/monal/util/toolbox.py":1342
 * Les cls sont allonges alignes sur la plus longue."""
 *     ll = max(len(key) for key in list(dic.keys()))
 *     for key, value in list(dic.items()):             # <<<<<<<<<<<<<<
 *         if dico2 is None:
 *             print(("%s%s%s\t%s%s" %(intro, key, blank(ll - len(key)), inter, value)))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.PrettyPrintDic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ll);
  __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;
}

/* "metaphor/monal/util/toolbox.py":1352
 * #     return not any(val1 != val2 for val1, val2 in zip( lst1, lst2 ))
 * 
 * def FalseToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if not cond: return ''
 *     return value
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_141FalseToEmpty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_141FalseToEmpty = {"FalseToEmpty", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_141FalseToEmpty, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_141FalseToEmpty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_cond = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("FalseToEmpty (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_cond,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("FalseToEmpty", 1, 2, 2, 1); __PYX_ERR(0, 1352, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "FalseToEmpty") < 0)) __PYX_ERR(0, 1352, __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_value = values[0];
    __pyx_v_cond = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("FalseToEmpty", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1352, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.FalseToEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_140FalseToEmpty(__pyx_self, __pyx_v_value, __pyx_v_cond);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_140FalseToEmpty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cond) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("FalseToEmpty", 0);

  /* "metaphor/monal/util/toolbox.py":1353
 * 
 * def FalseToEmpty(value, cond):
 *     if not cond: return ''             # <<<<<<<<<<<<<<
 *     return value
 * def TrueToEmpty(value, cond):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_r = __pyx_kp_u__17;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1354
 * def FalseToEmpty(value, cond):
 *     if not cond: return ''
 *     return value             # <<<<<<<<<<<<<<
 * def TrueToEmpty(value, cond):
 *     if cond: return ''
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1352
 * #     return not any(val1 != val2 for val1, val2 in zip( lst1, lst2 ))
 * 
 * def FalseToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if not cond: return ''
 *     return value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.FalseToEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1355
 *     if not cond: return ''
 *     return value
 * def TrueToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if cond: return ''
 *     return value
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_143TrueToEmpty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_143TrueToEmpty = {"TrueToEmpty", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_143TrueToEmpty, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_143TrueToEmpty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_cond = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("TrueToEmpty (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_cond,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("TrueToEmpty", 1, 2, 2, 1); __PYX_ERR(0, 1355, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "TrueToEmpty") < 0)) __PYX_ERR(0, 1355, __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_value = values[0];
    __pyx_v_cond = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("TrueToEmpty", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1355, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.TrueToEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_142TrueToEmpty(__pyx_self, __pyx_v_value, __pyx_v_cond);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_142TrueToEmpty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cond) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("TrueToEmpty", 0);

  /* "metaphor/monal/util/toolbox.py":1356
 *     return value
 * def TrueToEmpty(value, cond):
 *     if cond: return ''             # <<<<<<<<<<<<<<
 *     return value
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1356, __pyx_L1_error)
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_r = __pyx_kp_u__17;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1357
 * def TrueToEmpty(value, cond):
 *     if cond: return ''
 *     return value             # <<<<<<<<<<<<<<
 * 
 * def dataIterator(titles, *iterlist):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1355
 *     if not cond: return ''
 *     return value
 * def TrueToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if cond: return ''
 *     return value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.TrueToEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_146generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1359
 *     return value
 * 
 * def dataIterator(titles, *iterlist):             # <<<<<<<<<<<<<<
 *     yield list(titles)
 *     #ll = len(iterlist)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_145dataIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_145dataIterator = {"dataIterator", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_145dataIterator, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_145dataIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_titles = 0;
  PyObject *__pyx_v_iterlist = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataIterator (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_iterlist = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_iterlist)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_iterlist);
  } else {
    __pyx_v_iterlist = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_titles,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_titles)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "dataIterator") < 0)) __PYX_ERR(0, 1359, __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_titles = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dataIterator", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1359, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_iterlist);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.dataIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_144dataIterator(__pyx_self, __pyx_v_titles, __pyx_v_iterlist);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_144dataIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_titles, PyObject *__pyx_v_iterlist) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1359, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_titles = __pyx_v_titles;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_titles);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_titles);
  __pyx_cur_scope->__pyx_v_iterlist = __pyx_v_iterlist;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterlist);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterlist);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_146generator2, __pyx_codeobj__68, (PyObject *) __pyx_cur_scope, __pyx_n_s_dataIterator, __pyx_n_s_dataIterator, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.dataIterator", __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_8metaphor_5monal_4util_7toolbox_146generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)__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 *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataIterator", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1359, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1360
 * 
 * def dataIterator(titles, *iterlist):
 *     yield list(titles)             # <<<<<<<<<<<<<<
 *     #ll = len(iterlist)
 *     for vallist in zip(*iterlist):
 */
  __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_titles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1360, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1362
 *     yield list(titles)
 *     #ll = len(iterlist)
 *     for vallist in zip(*iterlist):             # <<<<<<<<<<<<<<
 *         yield(list(vallist))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_cur_scope->__pyx_v_iterlist, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1362, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1362, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1362, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1362, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_vallist);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_vallist, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1363
 *     #ll = len(iterlist)
 *     for vallist in zip(*iterlist):
 *         yield(list(vallist))             # <<<<<<<<<<<<<<
 * 
 * def nonZeroToOne(val):
 */
    __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_vallist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __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();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L7_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_ERR(0, 1363, __pyx_L1_error)

    /* "metaphor/monal/util/toolbox.py":1362
 *     yield list(titles)
 *     #ll = len(iterlist)
 *     for vallist in zip(*iterlist):             # <<<<<<<<<<<<<<
 *         yield(list(vallist))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/monal/util/toolbox.py":1359
 *     return value
 * 
 * def dataIterator(titles, *iterlist):             # <<<<<<<<<<<<<<
 *     yield list(titles)
 *     #ll = len(iterlist)
 */

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

/* "metaphor/monal/util/toolbox.py":1365
 *         yield(list(vallist))
 * 
 * def nonZeroToOne(val):             # <<<<<<<<<<<<<<
 *     if val != 0:
 *         return 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_148nonZeroToOne(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_148nonZeroToOne = {"nonZeroToOne", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_148nonZeroToOne, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_148nonZeroToOne(PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nonZeroToOne (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_147nonZeroToOne(__pyx_self, ((PyObject *)__pyx_v_val));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_147nonZeroToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("nonZeroToOne", 0);

  /* "metaphor/monal/util/toolbox.py":1366
 * 
 * def nonZeroToOne(val):
 *     if val != 0:             # <<<<<<<<<<<<<<
 *         return 1
 *     return 0
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "metaphor/monal/util/toolbox.py":1367
 * def nonZeroToOne(val):
 *     if val != 0:
 *         return 1             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_1);
    __pyx_r = __pyx_int_1;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1366
 * 
 * def nonZeroToOne(val):
 *     if val != 0:             # <<<<<<<<<<<<<<
 *         return 1
 *     return 0
 */
  }

  /* "metaphor/monal/util/toolbox.py":1368
 *     if val != 0:
 *         return 1
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * def reversed_enumerate(iterable):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1365
 *         yield(list(vallist))
 * 
 * def nonZeroToOne(val):             # <<<<<<<<<<<<<<
 *     if val != 0:
 *         return 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.nonZeroToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_151generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1370
 *     return 0
 * 
 * def reversed_enumerate(iterable):             # <<<<<<<<<<<<<<
 *     try:
 *         n = len(iterable)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_150reversed_enumerate(PyObject *__pyx_self, PyObject *__pyx_v_iterable); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_150reversed_enumerate = {"reversed_enumerate", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_150reversed_enumerate, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_150reversed_enumerate(PyObject *__pyx_self, PyObject *__pyx_v_iterable) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reversed_enumerate (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_149reversed_enumerate(__pyx_self, ((PyObject *)__pyx_v_iterable));

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_149reversed_enumerate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iterable) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reversed_enumerate", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1370, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_iterable = __pyx_v_iterable;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterable);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterable);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_151generator3, __pyx_codeobj__69, (PyObject *) __pyx_cur_scope, __pyx_n_s_reversed_enumerate, __pyx_n_s_reversed_enumerate, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1370, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.reversed_enumerate", __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_8metaphor_5monal_4util_7toolbox_151generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)__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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reversed_enumerate", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L14_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1370, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1371
 * 
 * def reversed_enumerate(iterable):
 *     try:             # <<<<<<<<<<<<<<
 *         n = len(iterable)
 *         seq = iterable
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":1372
 * def reversed_enumerate(iterable):
 *     try:
 *         n = len(iterable)             # <<<<<<<<<<<<<<
 *         seq = iterable
 *     except:
 */
      __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_iterable); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1372, __pyx_L4_error)
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1372, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_cur_scope->__pyx_v_n = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "metaphor/monal/util/toolbox.py":1373
 *     try:
 *         n = len(iterable)
 *         seq = iterable             # <<<<<<<<<<<<<<
 *     except:
 *         seq = list(iterable)
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_iterable);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_iterable);
      __pyx_cur_scope->__pyx_v_seq = __pyx_cur_scope->__pyx_v_iterable;

      /* "metaphor/monal/util/toolbox.py":1371
 * 
 * def reversed_enumerate(iterable):
 *     try:             # <<<<<<<<<<<<<<
 *         n = len(iterable)
 *         seq = iterable
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/monal/util/toolbox.py":1374
 *         n = len(iterable)
 *         seq = iterable
 *     except:             # <<<<<<<<<<<<<<
 *         seq = list(iterable)
 *         n = len(seq)
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox.reversed_enumerate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1374, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "metaphor/monal/util/toolbox.py":1375
 *         seq = iterable
 *     except:
 *         seq = list(iterable)             # <<<<<<<<<<<<<<
 *         n = len(seq)
 *     for val in reversed(seq):
 */
      __pyx_t_8 = PySequence_List(__pyx_cur_scope->__pyx_v_iterable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1375, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_seq);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_seq, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/monal/util/toolbox.py":1376
 *     except:
 *         seq = list(iterable)
 *         n = len(seq)             # <<<<<<<<<<<<<<
 *     for val in reversed(seq):
 *         n -= 1
 */
      __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_seq); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1376, __pyx_L6_except_error)
      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1376, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_exception_handled;
    }
    __pyx_L6_except_error:;

    /* "metaphor/monal/util/toolbox.py":1371
 * 
 * def reversed_enumerate(iterable):
 *     try:             # <<<<<<<<<<<<<<
 *         n = len(iterable)
 *         seq = iterable
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L9_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":1377
 *         seq = list(iterable)
 *         n = len(seq)
 *     for val in reversed(seq):             # <<<<<<<<<<<<<<
 *         n -= 1
 *         yield n, val
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_cur_scope->__pyx_v_seq); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1377, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1377, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1377, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/monal/util/toolbox.py":1378
 *         n = len(seq)
 *     for val in reversed(seq):
 *         n -= 1             # <<<<<<<<<<<<<<
 *         yield n, val
 * 
 */
    __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/monal/util/toolbox.py":1379
 *     for val in reversed(seq):
 *         n -= 1
 *         yield n, val             # <<<<<<<<<<<<<<
 * 
 * def _linkstr(a, b, c="", linker="_"):
 */
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_n);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_val);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L14_resume_from_yield:;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_6);
    __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1379, __pyx_L1_error)

    /* "metaphor/monal/util/toolbox.py":1377
 *         seq = list(iterable)
 *         n = len(seq)
 *     for val in reversed(seq):             # <<<<<<<<<<<<<<
 *         n -= 1
 *         yield n, val
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/monal/util/toolbox.py":1370
 *     return 0
 * 
 * def reversed_enumerate(iterable):             # <<<<<<<<<<<<<<
 *     try:
 *         n = len(iterable)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("reversed_enumerate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1381
 *         yield n, val
 * 
 * def _linkstr(a, b, c="", linker="_"):             # <<<<<<<<<<<<<<
 *     if c:
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_153_linkstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_153_linkstr = {"_linkstr", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_153_linkstr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_153_linkstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_c = 0;
  PyObject *__pyx_v_linker = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linkstr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_c_2,&__pyx_n_s_linker,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[3] = ((PyObject *)((PyObject*)__pyx_n_u__70));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_linkstr", 0, 2, 4, 1); __PYX_ERR(0, 1381, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_linker);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_linkstr") < 0)) __PYX_ERR(0, 1381, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
    __pyx_v_c = values[2];
    __pyx_v_linker = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linkstr", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1381, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox._linkstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_152_linkstr(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_linker);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_152_linkstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_linker) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_linkstr", 0);

  /* "metaphor/monal/util/toolbox.py":1382
 * 
 * def _linkstr(a, b, c="", linker="_"):
 *     if c:             # <<<<<<<<<<<<<<
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_c); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1382, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "metaphor/monal/util/toolbox.py":1383
 * def _linkstr(a, b, c="", linker="_"):
 *     if c:
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)             # <<<<<<<<<<<<<<
 *     else:
 *         return "%s%s%s" % (a, linker, b)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_a), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_linker), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_b), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_linker), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_c), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1382
 * 
 * def _linkstr(a, b, c="", linker="_"):
 *     if c:             # <<<<<<<<<<<<<<
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 *     else:
 */
  }

  /* "metaphor/monal/util/toolbox.py":1385
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 *     else:
 *         return "%s%s%s" % (a, linker, b)             # <<<<<<<<<<<<<<
 * 
 * # def xore(datastr, key):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_a), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_linker), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_b), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "metaphor/monal/util/toolbox.py":1381
 *         yield n, val
 * 
 * def _linkstr(a, b, c="", linker="_"):             # <<<<<<<<<<<<<<
 *     if c:
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox._linkstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_155singleton2(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_155singleton2 = {"singleton2", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_155singleton2, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_155singleton2(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("singleton2 (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_154singleton2(__pyx_self, ((PyObject *)__pyx_v_cls));

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

/* "metaphor/monal/util/toolbox.py":1416
 * def singleton2(cls):
 *     instance = cls()
 *     instance.__call__ = lambda: instance             # <<<<<<<<<<<<<<
 *     return instance
 * 
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda5", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_instance)) { __Pyx_RaiseClosureNameError("instance"); __PYX_ERR(0, 1416, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_instance);
  __pyx_r = __pyx_cur_scope->__pyx_v_instance;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.singleton2.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_154singleton2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("singleton2", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1414, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "metaphor/monal/util/toolbox.py":1415
 * 
 * def singleton2(cls):
 *     instance = cls()             # <<<<<<<<<<<<<<
 *     instance.__call__ = lambda: instance
 *     return instance
 */
  __Pyx_INCREF(__pyx_v_cls);
  __pyx_t_2 = __pyx_v_cls; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_instance = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1416
 * def singleton2(cls):
 *     instance = cls()
 *     instance.__call__ = lambda: instance             # <<<<<<<<<<<<<<
 *     return instance
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10singleton2_lambda5, 0, __pyx_n_s_singleton2_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_instance, __pyx_n_s_call, __pyx_t_1) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1417
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 *     return instance             # <<<<<<<<<<<<<<
 * 
 * def singleton(cls):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_instance);
  __pyx_r = __pyx_cur_scope->__pyx_v_instance;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.singleton2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1419
 *     return instance
 * 
 * def singleton(cls):             # <<<<<<<<<<<<<<
 *     ''' Use class as singleton. '''
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_157singleton(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_156singleton[] = " Use class as singleton. ";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_157singleton = {"singleton", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_157singleton, METH_O, __pyx_doc_8metaphor_5monal_4util_7toolbox_156singleton};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_157singleton(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("singleton (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_156singleton(__pyx_self, ((PyObject *)__pyx_v_cls));

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

/* "metaphor/monal/util/toolbox.py":1425
 * 
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_9singleton_1singleton_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_9singleton_1singleton_new = {"singleton_new", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_9singleton_1singleton_new, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_9singleton_1singleton_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("singleton_new (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,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) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "singleton_new") < 0)) __PYX_ERR(0, 1425, __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_cls = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("singleton_new", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1425, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.singleton.singleton_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_9singleton_singleton_new(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_9singleton_singleton_new(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_it = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("singleton_new", 0);

  /* "metaphor/monal/util/toolbox.py":1426
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):
 *         it =  cls.__dict__.get('__it__')             # <<<<<<<<<<<<<<
 *         if it is not None:
 *             return it
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1427
 *     def singleton_new(cls, *args, **kw):
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:             # <<<<<<<<<<<<<<
 *             return it
 * 
 */
  __pyx_t_3 = (__pyx_v_it != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":1428
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:
 *             return it             # <<<<<<<<<<<<<<
 * 
 *         cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_it);
    __pyx_r = __pyx_v_it;
    goto __pyx_L0;

    /* "metaphor/monal/util/toolbox.py":1427
 *     def singleton_new(cls, *args, **kw):
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:             # <<<<<<<<<<<<<<
 *             return it
 * 
 */
  }

  /* "metaphor/monal/util/toolbox.py":1430
 *             return it
 * 
 *         cls.__it__ = it = cls.__new_original__(cls, *args, **kw)             # <<<<<<<<<<<<<<
 *         it.__init_original__(*args, **kw)
 *         return it
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_new_original); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls);
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_it, __pyx_t_2) < 0) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1431
 * 
 *         cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
 *         it.__init_original__(*args, **kw)             # <<<<<<<<<<<<<<
 *         return it
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_it, __pyx_n_s_init_original); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/monal/util/toolbox.py":1432
 *         cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
 *         it.__init_original__(*args, **kw)
 *         return it             # <<<<<<<<<<<<<<
 * 
 *     cls.__new__ = singleton_new
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_it);
  __pyx_r = __pyx_v_it;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1425
 * 
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.singleton.singleton_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1419
 *     return instance
 * 
 * def singleton(cls):             # <<<<<<<<<<<<<<
 *     ''' Use class as singleton. '''
 * 
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_156singleton(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_v_singleton_new = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("singleton", 0);

  /* "metaphor/monal/util/toolbox.py":1422
 *     ''' Use class as singleton. '''
 * 
 *     cls.__new_original__ = cls.__new__             # <<<<<<<<<<<<<<
 * 
 *     @functools.wraps(cls.__new__)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_new_original, __pyx_t_1) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1424
 *     cls.__new_original__ = cls.__new__
 * 
 *     @functools.wraps(cls.__new__)             # <<<<<<<<<<<<<<
 *     def singleton_new(cls, *args, **kw):
 *         it =  cls.__dict__.get('__it__')
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":1425
 * 
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_9singleton_1singleton_new, 0, __pyx_n_s_singleton_locals_singleton_new, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_singleton_new = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1434
 *         return it
 * 
 *     cls.__new__ = singleton_new             # <<<<<<<<<<<<<<
 *     cls.__init_original__ = cls.__init__
 *     cls.__init__ = object.__init__
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_new, __pyx_v_singleton_new) < 0) __PYX_ERR(0, 1434, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1435
 * 
 *     cls.__new__ = singleton_new
 *     cls.__init_original__ = cls.__init__             # <<<<<<<<<<<<<<
 *     cls.__init__ = object.__init__
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_init_original, __pyx_t_1) < 0) __PYX_ERR(0, 1435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1436
 *     cls.__new__ = singleton_new
 *     cls.__init_original__ = cls.__init__
 *     cls.__init__ = object.__init__             # <<<<<<<<<<<<<<
 * 
 *     return cls
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1438
 *     cls.__init__ = object.__init__
 * 
 *     return cls             # <<<<<<<<<<<<<<
 * 
 * class autoprop(type):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cls);
  __pyx_r = __pyx_v_cls;
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1419
 *     return instance
 * 
 * def singleton(cls):             # <<<<<<<<<<<<<<
 *     ''' Use class as singleton. '''
 * 
 */

  /* function 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_6);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.singleton", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_singleton_new);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8autoprop_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_8autoprop_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_8autoprop_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_8autoprop_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_bases = 0;
  PyObject *__pyx_v_dico = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_name,&__pyx_n_s_bases,&__pyx_n_s_dico,0};
    PyObject* values[4] = {0,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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 1446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bases)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 1446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dico)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 1446, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1446, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_cls = values[0];
    __pyx_v_name = values[1];
    __pyx_v_bases = values[2];
    __pyx_v_dico = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1446, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.autoprop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop___init__(__pyx_self, __pyx_v_cls, __pyx_v_name, __pyx_v_bases, __pyx_v_dico);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1455
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):             # <<<<<<<<<<<<<<
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1455, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_autoprop___init___locals_genexpr, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.autoprop.__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_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1455, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_props)) { __Pyx_RaiseClosureNameError("props"); __PYX_ERR(0, 1455, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_props == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 1455, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1455, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1455, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1455, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_val, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
      __pyx_r = __pyx_cur_scope->__pyx_v_name;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L9_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_3 = __pyx_cur_scope->__pyx_t_1;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1455, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_bases, PyObject *__pyx_v_dico) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *__pyx_cur_scope;
  PyObject *__pyx_v_fget = NULL;
  PyObject *__pyx_v_fset = NULL;
  PyObject *__pyx_v_fdel = NULL;
  PyObject *__pyx_v_fdoc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1446, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_name);

  /* "metaphor/monal/util/toolbox.py":1447
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):
 *         super(autoprop, cls).__init__(name, bases, dico)             # <<<<<<<<<<<<<<
 *         props = {}
 *         for name in list(cls.__dict__.keys()):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_autoprop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cls);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_name, __pyx_v_bases, __pyx_v_dico};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_name, __pyx_v_bases, __pyx_v_dico};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_bases);
    __Pyx_GIVEREF(__pyx_v_bases);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_bases);
    __Pyx_INCREF(__pyx_v_dico);
    __Pyx_GIVEREF(__pyx_v_dico);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_dico);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1448
 *     def __init__(cls, name, bases, dico):
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}             # <<<<<<<<<<<<<<
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_props = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1449
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 *         for name in list(cls.__dict__.keys()):             # <<<<<<<<<<<<<<
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1449, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/monal/util/toolbox.py":1450
 *         props = {}
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }

    /* "metaphor/monal/util/toolbox.py":1451
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }

    /* "metaphor/monal/util/toolbox.py":1452
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }

    /* "metaphor/monal/util/toolbox.py":1453
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):             # <<<<<<<<<<<<<<
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;

    /* "metaphor/monal/util/toolbox.py":1450
 *         props = {}
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 */
    if (__pyx_t_7) {

      /* "metaphor/monal/util/toolbox.py":1454
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1             # <<<<<<<<<<<<<<
 *         for name in (name for name, val in list(props.items()) if val==1):
 *             fget = getattr(cls, "_get_%s" % name, None)
 */
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_name, 5, 0, NULL, NULL, &__pyx_slice__78, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_props, __pyx_t_5, __pyx_int_1) < 0)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/monal/util/toolbox.py":1450
 *         props = {}
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 */
    }

    /* "metaphor/monal/util/toolbox.py":1449
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 *         for name in list(cls.__dict__.keys()):             # <<<<<<<<<<<<<<
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1455
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):             # <<<<<<<<<<<<<<
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)
 */
  __pyx_t_1 = __pyx_pf_8metaphor_5monal_4util_7toolbox_8autoprop_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1455, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1455, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1456
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):
 *             fget = getattr(cls, "_get_%s" % name, None)             # <<<<<<<<<<<<<<
 *             fset = getattr(cls, "_set_%s" % name, None)
 *             fdel = getattr(cls, "_del_%s" % name, None)
 */
    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_get__s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fget, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":1457
 *         for name in (name for name, val in list(props.items()) if val==1):
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)             # <<<<<<<<<<<<<<
 *             fdel = getattr(cls, "_del_%s" % name, None)
 *             fdoc = getattr(cls, "_doc_%s" % name, None)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_set__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fset, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1458
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)
 *             fdel = getattr(cls, "_del_%s" % name, None)             # <<<<<<<<<<<<<<
 *             fdoc = getattr(cls, "_doc_%s" % name, None)
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))
 */
    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_del__s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fdel, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":1459
 *             fset = getattr(cls, "_set_%s" % name, None)
 *             fdel = getattr(cls, "_del_%s" % name, None)
 *             fdoc = getattr(cls, "_doc_%s" % name, None)             # <<<<<<<<<<<<<<
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))
 *             if hasattr(cls, "_get_%s" % name):
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_doc__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fdoc, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1460
 *             fdel = getattr(cls, "_del_%s" % name, None)
 *             fdoc = getattr(cls, "_doc_%s" % name, None)
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))             # <<<<<<<<<<<<<<
 *             if hasattr(cls, "_get_%s" % name):
 *                 delattr(cls, "_get_%s" % name)
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_fget);
    __Pyx_GIVEREF(__pyx_v_fget);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fget);
    __Pyx_INCREF(__pyx_v_fset);
    __Pyx_GIVEREF(__pyx_v_fset);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_fset);
    __Pyx_INCREF(__pyx_v_fdel);
    __Pyx_GIVEREF(__pyx_v_fdel);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_fdel);
    __Pyx_INCREF(__pyx_v_fdoc);
    __Pyx_GIVEREF(__pyx_v_fdoc);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_fdoc);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/monal/util/toolbox.py":1461
 *             fdoc = getattr(cls, "_doc_%s" % name, None)
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))
 *             if hasattr(cls, "_get_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_get_%s" % name)
 *             if hasattr(cls, "_set_%s" % name):
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_get__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_HasAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "metaphor/monal/util/toolbox.py":1462
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))
 *             if hasattr(cls, "_get_%s" % name):
 *                 delattr(cls, "_get_%s" % name)             # <<<<<<<<<<<<<<
 *             if hasattr(cls, "_set_%s" % name):
 *                 delattr(cls, "_set_%s" % name)
 */
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_get__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyObject_DelAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1462, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":1461
 *             fdoc = getattr(cls, "_doc_%s" % name, None)
 *             setattr(cls, name, property(fget, fset, fdel, fdoc))
 *             if hasattr(cls, "_get_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_get_%s" % name)
 *             if hasattr(cls, "_set_%s" % name):
 */
    }

    /* "metaphor/monal/util/toolbox.py":1463
 *             if hasattr(cls, "_get_%s" % name):
 *                 delattr(cls, "_get_%s" % name)
 *             if hasattr(cls, "_set_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_set_%s" % name)
 *             if hasattr(cls, "_del_%s" % name):
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_set__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_HasAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1463, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "metaphor/monal/util/toolbox.py":1464
 *                 delattr(cls, "_get_%s" % name)
 *             if hasattr(cls, "_set_%s" % name):
 *                 delattr(cls, "_set_%s" % name)             # <<<<<<<<<<<<<<
 *             if hasattr(cls, "_del_%s" % name):
 *                 delattr(cls, "_del_%s" % name)
 */
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_set__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyObject_DelAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":1463
 *             if hasattr(cls, "_get_%s" % name):
 *                 delattr(cls, "_get_%s" % name)
 *             if hasattr(cls, "_set_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_set_%s" % name)
 *             if hasattr(cls, "_del_%s" % name):
 */
    }

    /* "metaphor/monal/util/toolbox.py":1465
 *             if hasattr(cls, "_set_%s" % name):
 *                 delattr(cls, "_set_%s" % name)
 *             if hasattr(cls, "_del_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_del_%s" % name)
 *             if hasattr(cls, "_doc_%s" % name):
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_del__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_HasAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "metaphor/monal/util/toolbox.py":1466
 *                 delattr(cls, "_set_%s" % name)
 *             if hasattr(cls, "_del_%s" % name):
 *                 delattr(cls, "_del_%s" % name)             # <<<<<<<<<<<<<<
 *             if hasattr(cls, "_doc_%s" % name):
 *                 delattr(cls, "_doc_%s" % name)
 */
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_del__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyObject_DelAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1466, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":1465
 *             if hasattr(cls, "_set_%s" % name):
 *                 delattr(cls, "_set_%s" % name)
 *             if hasattr(cls, "_del_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_del_%s" % name)
 *             if hasattr(cls, "_doc_%s" % name):
 */
    }

    /* "metaphor/monal/util/toolbox.py":1467
 *             if hasattr(cls, "_del_%s" % name):
 *                 delattr(cls, "_del_%s" % name)
 *             if hasattr(cls, "_doc_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_doc_%s" % name)
 * 
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_doc__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_HasAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "metaphor/monal/util/toolbox.py":1468
 *                 delattr(cls, "_del_%s" % name)
 *             if hasattr(cls, "_doc_%s" % name):
 *                 delattr(cls, "_doc_%s" % name)             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------------
 */
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_doc__s, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyObject_DelAttr(__pyx_v_cls, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/monal/util/toolbox.py":1467
 *             if hasattr(cls, "_del_%s" % name):
 *                 delattr(cls, "_del_%s" % name)
 *             if hasattr(cls, "_doc_%s" % name):             # <<<<<<<<<<<<<<
 *                 delattr(cls, "_doc_%s" % name)
 * 
 */
    }

    /* "metaphor/monal/util/toolbox.py":1455
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):             # <<<<<<<<<<<<<<
 *             fget = getattr(cls, "_get_%s" % name, None)
 *             fset = getattr(cls, "_set_%s" % name, None)
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.autoprop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fget);
  __Pyx_XDECREF(__pyx_v_fset);
  __Pyx_XDECREF(__pyx_v_fdel);
  __Pyx_XDECREF(__pyx_v_fdoc);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1506
 * #             pprint(*objects, **kwd)
 * 
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):             # <<<<<<<<<<<<<<
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_171__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_Fct);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_Fct);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_Fct);
  __Pyx_INCREF(((PyObject*)__pyx_kp_u__17));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_u__17));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_kp_u__17));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_159deletefilebyFonction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_159deletefilebyFonction = {"deletefilebyFonction", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_159deletefilebyFonction, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_159deletefilebyFonction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_Fct = 0;
  PyObject *__pyx_v_root = 0;
  PyObject *__pyx_v_recursive = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deletefilebyFonction (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Fct,&__pyx_n_s_root,&__pyx_n_s_recursive,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[0] = __pyx_dynamic_args->__pyx_arg_Fct;
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u__17));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Fct);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deletefilebyFonction") < 0)) __PYX_ERR(0, 1506, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_Fct = values[0];
    __pyx_v_root = values[1];
    __pyx_v_recursive = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deletefilebyFonction", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1506, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.deletefilebyFonction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_158deletefilebyFonction(__pyx_self, __pyx_v_Fct, __pyx_v_root, __pyx_v_recursive);

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

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_158deletefilebyFonction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Fct, PyObject *__pyx_v_root, PyObject *__pyx_v_recursive) {
  PyObject *__pyx_v_dirs = NULL;
  PyObject *__pyx_v_files = NULL;
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_v_cond = NULL;
  PyObject *__pyx_v_tg = NULL;
  PyObject *__pyx_v_dirname = NULL;
  PyObject *__pyx_v_pth = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("deletefilebyFonction", 0);
  __Pyx_INCREF(__pyx_v_root);

  /* "metaphor/monal/util/toolbox.py":1508
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):             # <<<<<<<<<<<<<<
 *         for filename in files:
 *             cond = Fct(filename)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_walk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_root};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_root};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_root);
      __Pyx_GIVEREF(__pyx_v_root);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_root);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1508, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1508, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1508, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1508, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1508, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 1508, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1508, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_root, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dirs, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_files, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/monal/util/toolbox.py":1509
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 *         for filename in files:             # <<<<<<<<<<<<<<
 *             cond = Fct(filename)
 *             #_, fext = os.path.splitext(filename)
 */
    if (likely(PyList_CheckExact(__pyx_v_files)) || PyTuple_CheckExact(__pyx_v_files)) {
      __pyx_t_1 = __pyx_v_files; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_files); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1509, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1509, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1509, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1509, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/monal/util/toolbox.py":1510
 *     for root, dirs, files in os.walk(root):
 *         for filename in files:
 *             cond = Fct(filename)             # <<<<<<<<<<<<<<
 *             #_, fext = os.path.splitext(filename)
 *             #if fext.lower() == ext:
 */
      __Pyx_INCREF(__pyx_v_Fct);
      __pyx_t_2 = __pyx_v_Fct; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1510, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1510, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1510, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1510, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_filename);
          __Pyx_GIVEREF(__pyx_v_filename);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1510, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cond, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/monal/util/toolbox.py":1513
 *             #_, fext = os.path.splitext(filename)
 *             #if fext.lower() == ext:
 *             if cond:             # <<<<<<<<<<<<<<
 *                 tg = os.path.join(root, filename)
 *                 os.remove(tg)
 */
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
      if (__pyx_t_12) {

        /* "metaphor/monal/util/toolbox.py":1514
 *             #if fext.lower() == ext:
 *             if cond:
 *                 tg = os.path.join(root, filename)             # <<<<<<<<<<<<<<
 *                 os.remove(tg)
 *         if recursive:
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1514, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_root, __pyx_v_filename};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_root, __pyx_v_filename};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (__pyx_t_8) {
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
          }
          __Pyx_INCREF(__pyx_v_root);
          __Pyx_GIVEREF(__pyx_v_root);
          PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_13, __pyx_v_root);
          __Pyx_INCREF(__pyx_v_filename);
          __Pyx_GIVEREF(__pyx_v_filename);
          PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_13, __pyx_v_filename);
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_tg, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":1515
 *             if cond:
 *                 tg = os.path.join(root, filename)
 *                 os.remove(tg)             # <<<<<<<<<<<<<<
 *         if recursive:
 *             for dirname in dirs:
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_tg};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_tg};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1515, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
            __Pyx_INCREF(__pyx_v_tg);
            __Pyx_GIVEREF(__pyx_v_tg);
            PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_tg);
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":1513
 *             #_, fext = os.path.splitext(filename)
 *             #if fext.lower() == ext:
 *             if cond:             # <<<<<<<<<<<<<<
 *                 tg = os.path.join(root, filename)
 *                 os.remove(tg)
 */
      }

      /* "metaphor/monal/util/toolbox.py":1509
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 *         for filename in files:             # <<<<<<<<<<<<<<
 *             cond = Fct(filename)
 *             #_, fext = os.path.splitext(filename)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1516
 *                 tg = os.path.join(root, filename)
 *                 os.remove(tg)
 *         if recursive:             # <<<<<<<<<<<<<<
 *             for dirname in dirs:
 *                 pth = os.path.join(root, dirname)
 */
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_recursive); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1516, __pyx_L1_error)
    if (__pyx_t_12) {

      /* "metaphor/monal/util/toolbox.py":1517
 *                 os.remove(tg)
 *         if recursive:
 *             for dirname in dirs:             # <<<<<<<<<<<<<<
 *                 pth = os.path.join(root, dirname)
 *                 deletefilebyFonction(Fct, pth, True)
 */
      if (likely(PyList_CheckExact(__pyx_v_dirs)) || PyTuple_CheckExact(__pyx_v_dirs)) {
        __pyx_t_1 = __pyx_v_dirs; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dirs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1517, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1517, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1517, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1517, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1517, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_11(__pyx_t_1);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1517, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_dirname, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":1518
 *         if recursive:
 *             for dirname in dirs:
 *                 pth = os.path.join(root, dirname)             # <<<<<<<<<<<<<<
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1518, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_root, __pyx_v_dirname};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1518, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_root, __pyx_v_dirname};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1518, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1518, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (__pyx_t_8) {
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
          }
          __Pyx_INCREF(__pyx_v_root);
          __Pyx_GIVEREF(__pyx_v_root);
          PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_13, __pyx_v_root);
          __Pyx_INCREF(__pyx_v_dirname);
          __Pyx_GIVEREF(__pyx_v_dirname);
          PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_13, __pyx_v_dirname);
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1518, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_pth, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":1519
 *             for dirname in dirs:
 *                 pth = os.path.join(root, dirname)
 *                 deletefilebyFonction(Fct, pth, True)             # <<<<<<<<<<<<<<
 * 
 * def binaries_directory():
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_deletefilebyFonction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_Fct, __pyx_v_pth, Py_True};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_Fct, __pyx_v_pth, Py_True};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
          }
          __Pyx_INCREF(__pyx_v_Fct);
          __Pyx_GIVEREF(__pyx_v_Fct);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_13, __pyx_v_Fct);
          __Pyx_INCREF(__pyx_v_pth);
          __Pyx_GIVEREF(__pyx_v_pth);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_v_pth);
          __Pyx_INCREF(Py_True);
          __Pyx_GIVEREF(Py_True);
          PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_13, Py_True);
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "metaphor/monal/util/toolbox.py":1517
 *                 os.remove(tg)
 *         if recursive:
 *             for dirname in dirs:             # <<<<<<<<<<<<<<
 *                 pth = os.path.join(root, dirname)
 *                 deletefilebyFonction(Fct, pth, True)
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":1516
 *                 tg = os.path.join(root, filename)
 *                 os.remove(tg)
 *         if recursive:             # <<<<<<<<<<<<<<
 *             for dirname in dirs:
 *                 pth = os.path.join(root, dirname)
 */
    }

    /* "metaphor/monal/util/toolbox.py":1508
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):             # <<<<<<<<<<<<<<
 *         for filename in files:
 *             cond = Fct(filename)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1506
 * #             pprint(*objects, **kwd)
 * 
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):             # <<<<<<<<<<<<<<
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.deletefilebyFonction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dirs);
  __Pyx_XDECREF(__pyx_v_files);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XDECREF(__pyx_v_cond);
  __Pyx_XDECREF(__pyx_v_tg);
  __Pyx_XDECREF(__pyx_v_dirname);
  __Pyx_XDECREF(__pyx_v_pth);
  __Pyx_XDECREF(__pyx_v_root);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_161binaries_directory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8metaphor_5monal_4util_7toolbox_160binaries_directory[] = "Return the installation directory, or None";
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_161binaries_directory = {"binaries_directory", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_161binaries_directory, METH_NOARGS, __pyx_doc_8metaphor_5monal_4util_7toolbox_160binaries_directory};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_161binaries_directory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("binaries_directory (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_160binaries_directory(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_5monal_4util_7toolbox_18binaries_directory_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/monal/util/toolbox.py":1527
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_18binaries_directory_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1527, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_5monal_4util_7toolbox_18binaries_directory_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_binaries_directory_locals_genexp, __pyx_n_s_metaphor_monal_util_toolbox); if (unlikely(!gen)) __PYX_ERR(0, 1527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.binaries_directory.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_8metaphor_5monal_4util_7toolbox_18binaries_directory_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1527, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1528
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (
 *             sys.prefix + '/lib/python%s/dist-packages/',             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/site-packages/',
 *             sys.prefix + '/local/lib/python%s/dist-packages/',
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_lib_python_s_dist_packages); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1529
 *         paths = (s % (py_version) for s in (
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',             # <<<<<<<<<<<<<<
 *             sys.prefix + '/local/lib/python%s/dist-packages/',
 *             sys.prefix + '/local/lib/python%s/site-packages/',
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_u_lib_python_s_site_packages); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/monal/util/toolbox.py":1530
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',
 *             sys.prefix + '/local/lib/python%s/dist-packages/',             # <<<<<<<<<<<<<<
 *             sys.prefix + '/local/lib/python%s/site-packages/',
 *             '/Library/Python/%s/site-packages/',
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_local_lib_python_s_dist_package); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":1531
 *             sys.prefix + '/lib/python%s/site-packages/',
 *             sys.prefix + '/local/lib/python%s/dist-packages/',
 *             sys.prefix + '/local/lib/python%s/site-packages/',             # <<<<<<<<<<<<<<
 *             '/Library/Python/%s/site-packages/',
 *         ))
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_prefix); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_u_local_lib_python_s_site_package); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/monal/util/toolbox.py":1528
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (
 *             sys.prefix + '/lib/python%s/dist-packages/',             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/site-packages/',
 *             sys.prefix + '/local/lib/python%s/dist-packages/',
 */
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_INCREF(__pyx_kp_u_Library_Python_s_site_packages);
  __Pyx_GIVEREF(__pyx_kp_u_Library_Python_s_site_packages);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_Library_Python_s_site_packages);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "metaphor/monal/util/toolbox.py":1527
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',
 */
  __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_6 >= 5) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __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_ERR(0, 1527, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_version)) { __Pyx_RaiseClosureNameError("py_version"); __PYX_ERR(0, 1527, __pyx_L1_error) }
    __pyx_t_5 = PyNumber_Remainder(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_version); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1527, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_160binaries_directory(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *__pyx_cur_scope;
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("binaries_directory", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1521, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "metaphor/monal/util/toolbox.py":1523
 * def binaries_directory():
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:             # <<<<<<<<<<<<<<
 *         paths = (getusersitepackages(),)
 *     else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_user, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "metaphor/monal/util/toolbox.py":1524
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 *         paths = (getusersitepackages(),)             # <<<<<<<<<<<<<<
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getusersitepackages); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_v_paths = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1523
 * def binaries_directory():
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:             # <<<<<<<<<<<<<<
 *         paths = (getusersitepackages(),)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "metaphor/monal/util/toolbox.py":1526
 *         paths = (getusersitepackages(),)
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])             # <<<<<<<<<<<<<<
 *         paths = (s % (py_version) for s in (
 *             sys.prefix + '/lib/python%s/dist-packages/',
 */
  /*else*/ {
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__46);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__46);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__46);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_py_version = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/monal/util/toolbox.py":1527
 *     else:
 *         py_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
 *         paths = (s % (py_version) for s in (             # <<<<<<<<<<<<<<
 *             sys.prefix + '/lib/python%s/dist-packages/',
 *             sys.prefix + '/lib/python%s/site-packages/',
 */
    __pyx_t_2 = __pyx_pf_8metaphor_5monal_4util_7toolbox_18binaries_directory_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_paths = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "metaphor/monal/util/toolbox.py":1535
 *         ))
 * 
 *     for path in paths:             # <<<<<<<<<<<<<<
 *         if os.path.exists(path):
 *             return path
 */
  if (likely(PyList_CheckExact(__pyx_v_paths)) || PyTuple_CheckExact(__pyx_v_paths)) {
    __pyx_t_2 = __pyx_v_paths; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_paths); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1535, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":1536
 * 
 *     for path in paths:
 *         if os.path.exists(path):             # <<<<<<<<<<<<<<
 *             return path
 *     #print('no installation path found', file=sys.stderr)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_path};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_path};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_path);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "metaphor/monal/util/toolbox.py":1537
 *     for path in paths:
 *         if os.path.exists(path):
 *             return path             # <<<<<<<<<<<<<<
 *     #print('no installation path found', file=sys.stderr)
 *     return None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_path);
      __pyx_r = __pyx_v_path;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "metaphor/monal/util/toolbox.py":1536
 * 
 *     for path in paths:
 *         if os.path.exists(path):             # <<<<<<<<<<<<<<
 *             return path
 *     #print('no installation path found', file=sys.stderr)
 */
    }

    /* "metaphor/monal/util/toolbox.py":1535
 *         ))
 * 
 *     for path in paths:             # <<<<<<<<<<<<<<
 *         if os.path.exists(path):
 *             return path
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":1539
 *             return path
 *     #print('no installation path found', file=sys.stderr)
 *     return None             # <<<<<<<<<<<<<<
 * 
 * def cleanfiles(root, ext):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.binaries_directory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_163cleanfiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_163cleanfiles = {"cleanfiles", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_163cleanfiles, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_163cleanfiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_root = 0;
  PyObject *__pyx_v_ext = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanfiles (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_ext,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ext)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cleanfiles", 1, 2, 2, 1); __PYX_ERR(0, 1541, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cleanfiles") < 0)) __PYX_ERR(0, 1541, __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_root = values[0];
    __pyx_v_ext = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cleanfiles", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1541, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cleanfiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_5monal_4util_7toolbox_162cleanfiles(__pyx_self, __pyx_v_root, __pyx_v_ext);

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

/* "metaphor/monal/util/toolbox.py":1543
 * def cleanfiles(root, ext):
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext             # <<<<<<<<<<<<<<
 *     deletefilebyFonction(Fct, root, True)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cleanfiles_lambda9(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_5monal_4util_7toolbox_10cleanfiles_lambda9 = {"lambda9", (PyCFunction)__pyx_pw_8metaphor_5monal_4util_7toolbox_10cleanfiles_lambda9, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_5monal_4util_7toolbox_10cleanfiles_lambda9(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda9(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("lambda9", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_splitext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_x);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __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_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_ext)) { __Pyx_RaiseClosureNameError("ext"); __PYX_ERR(0, 1543, __pyx_L1_error) }
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_ext, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cleanfiles.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */

static PyObject *__pyx_pf_8metaphor_5monal_4util_7toolbox_162cleanfiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_root, PyObject *__pyx_v_ext) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *__pyx_cur_scope;
  PyObject *__pyx_v_Fct = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("cleanfiles", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(__pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1541, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_ext = __pyx_v_ext;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ext);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ext);

  /* "metaphor/monal/util/toolbox.py":1542
 * 
 * def cleanfiles(root, ext):
 *     ext = ext.lower()             # <<<<<<<<<<<<<<
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 *     deletefilebyFonction(Fct, root, True)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ext, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ext);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ext, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1543
 * def cleanfiles(root, ext):
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext             # <<<<<<<<<<<<<<
 *     deletefilebyFonction(Fct, root, True)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10cleanfiles_lambda9, 0, __pyx_n_s_cleanfiles_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1544
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 *     deletefilebyFonction(Fct, root, True)             # <<<<<<<<<<<<<<
 * 
 * # def getExtraFields(maxreclist, pptyname, cols=[], richestimated=[],
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_deletefilebyFonction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_Fct, __pyx_v_root, Py_True};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_Fct, __pyx_v_root, Py_True};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_Fct);
    __Pyx_GIVEREF(__pyx_v_Fct);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_Fct);
    __Pyx_INCREF(__pyx_v_root);
    __Pyx_GIVEREF(__pyx_v_root);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_root);
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_True);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.monal.util.toolbox.cleanfiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Fct);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_mycmp);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)o;
  if (p->__pyx_v_mycmp) {
    e = (*v)(p->__pyx_v_mycmp, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key *)o;
  tmp = ((PyObject*)p->__pyx_v_mycmp);
  p->__pyx_v_mycmp = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct__cmp_to_key", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cur);
  Py_CLEAR(p->__pyx_v_start);
  Py_CLEAR(p->__pyx_v_step);
  Py_CLEAR(p->__pyx_v_stop);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange *)o;
  if (p->__pyx_v_cur) {
    e = (*v)(p->__pyx_v_cur, a); if (e) return e;
  }
  if (p->__pyx_v_start) {
    e = (*v)(p->__pyx_v_start, a); if (e) return e;
  }
  if (p->__pyx_v_step) {
    e = (*v)(p->__pyx_v_step, a); if (e) return e;
  }
  if (p->__pyx_v_stop) {
    e = (*v)(p->__pyx_v_stop, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_1_rrange", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_casesensitive);
  Py_CLEAR(p->__pyx_v_df);
  Py_CLEAR(p->__pyx_v_directory);
  Py_CLEAR(p->__pyx_v_ext);
  Py_CLEAR(p->__pyx_v_f);
  Py_CLEAR(p->__pyx_v_lf);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt *)o;
  if (p->__pyx_v_casesensitive) {
    e = (*v)(p->__pyx_v_casesensitive, a); if (e) return e;
  }
  if (p->__pyx_v_df) {
    e = (*v)(p->__pyx_v_df, a); if (e) return e;
  }
  if (p->__pyx_v_directory) {
    e = (*v)(p->__pyx_v_directory, a); if (e) return e;
  }
  if (p->__pyx_v_ext) {
    e = (*v)(p->__pyx_v_ext, a); if (e) return e;
  }
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  if (p->__pyx_v_lf) {
    e = (*v)(p->__pyx_v_lf, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_2_getFilesByExt", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_func);
  Py_CLEAR(p->__pyx_v_threading);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)o;
  if (p->__pyx_v_func) {
    e = (*v)(p->__pyx_v_func, a); if (e) return e;
  }
  if (p->__pyx_v_threading) {
    e = (*v)(p->__pyx_v_threading, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread *)o;
  tmp = ((PyObject*)p->__pyx_v_func);
  p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_threading);
  p->__pyx_v_threading = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_3_dothread", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_fillchar);
  Py_CLEAR(p->__pyx_v_iterator);
  Py_CLEAR(p->__pyx_v_limited);
  Py_CLEAR(p->__pyx_v_modifiedstr);
  Py_CLEAR(p->__pyx_v_sep);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)o;
  if (p->__pyx_v_fillchar) {
    e = (*v)(p->__pyx_v_fillchar, a); if (e) return e;
  }
  if (p->__pyx_v_iterator) {
    e = (*v)(p->__pyx_v_iterator, a); if (e) return e;
  }
  if (p->__pyx_v_limited) {
    e = (*v)(p->__pyx_v_limited, a); if (e) return e;
  }
  if (p->__pyx_v_modifiedstr) {
    e = (*v)(p->__pyx_v_modifiedstr, a); if (e) return e;
  }
  if (p->__pyx_v_sep) {
    e = (*v)(p->__pyx_v_sep, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx *)o;
  tmp = ((PyObject*)p->__pyx_v_fillchar);
  p->__pyx_v_fillchar = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iterator);
  p->__pyx_v_iterator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_limited);
  p->__pyx_v_limited = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_modifiedstr);
  p->__pyx_v_modifiedstr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_sep);
  p->__pyx_v_sep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_4_joinEx", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_val);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr, /*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_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_val);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_sepl);
  Py_CLEAR(p->__pyx_v_val);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_sepl) {
    e = (*v)(p->__pyx_v_sepl, a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr, /*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_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_dic);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)o;
  if (p->__pyx_v_dic) {
    e = (*v)(p->__pyx_v_dic, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic *)o;
  tmp = ((PyObject*)p->__pyx_v_dic);
  p->__pyx_v_dic = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_8_PrettyPrintDic", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_key);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_key) {
    e = (*v)(p->__pyx_v_key, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_9_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_iterlist);
  Py_CLEAR(p->__pyx_v_titles);
  Py_CLEAR(p->__pyx_v_vallist);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator *)o;
  if (p->__pyx_v_iterlist) {
    e = (*v)(p->__pyx_v_iterlist, a); if (e) return e;
  }
  if (p->__pyx_v_titles) {
    e = (*v)(p->__pyx_v_titles, a); if (e) return e;
  }
  if (p->__pyx_v_vallist) {
    e = (*v)(p->__pyx_v_vallist, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_10_dataIterator", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_iterable);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_seq);
  Py_CLEAR(p->__pyx_v_val);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate *)o;
  if (p->__pyx_v_iterable) {
    e = (*v)(p->__pyx_v_iterable, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_v_seq) {
    e = (*v)(p->__pyx_v_seq, a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_11_reversed_enumerate", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_instance);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)o;
  if (p->__pyx_v_instance) {
    e = (*v)(p->__pyx_v_instance, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 *)o;
  tmp = ((PyObject*)p->__pyx_v_instance);
  p->__pyx_v_instance = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_12_singleton2", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_props);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)o;
  if (p->__pyx_v_props) {
    e = (*v)(p->__pyx_v_props, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_props);
  p->__pyx_v_props = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_13___init__", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_val);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr, /*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_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *)o;
  Py_CLEAR(p->__pyx_v_py_version);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_15_binaries_directory", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___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_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_16_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr, /*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_8metaphor_5monal_4util_7toolbox___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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles[8];
static int __pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles = 0;

static PyObject *__pyx_tp_new_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles[--__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles));
    (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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(PyObject *o) {
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ext);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles)))) {
    __pyx_freelist_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles[__pyx_freecount_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles++] = ((struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)o;
  if (p->__pyx_v_ext) {
    e = (*v)(p->__pyx_v_ext, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *p = (struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles *)o;
  tmp = ((PyObject*)p->__pyx_v_ext);
  p->__pyx_v_ext = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.monal.util.toolbox.__pyx_scope_struct_17_cleanfiles", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles, /*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_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_toolbox(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_toolbox},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "toolbox",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_2, __pyx_k_0_2, sizeof(__pyx_k_0_2), 0, 1, 0, 0},
  {&__pyx_kp_u_0m, __pyx_k_0m, sizeof(__pyx_k_0m), 0, 1, 0, 0},
  {&__pyx_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
  {&__pyx_kp_u_1m, __pyx_k_1m, sizeof(__pyx_k_1m), 0, 1, 0, 0},
  {&__pyx_kp_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 0},
  {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0},
  {&__pyx_kp_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 0},
  {&__pyx_kp_u_4m, __pyx_k_4m, sizeof(__pyx_k_4m), 0, 1, 0, 0},
  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
  {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0},
  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
  {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
  {&__pyx_kp_u_91m, __pyx_k_91m, sizeof(__pyx_k_91m), 0, 1, 0, 0},
  {&__pyx_kp_u_92m, __pyx_k_92m, sizeof(__pyx_k_92m), 0, 1, 0, 0},
  {&__pyx_kp_u_93m, __pyx_k_93m, sizeof(__pyx_k_93m), 0, 1, 0, 0},
  {&__pyx_kp_u_94m, __pyx_k_94m, sizeof(__pyx_k_94m), 0, 1, 0, 0},
  {&__pyx_kp_u_95m, __pyx_k_95m, sizeof(__pyx_k_95m), 0, 1, 0, 0},
  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_kp_u_A_A_Za_z__1_w_Z, __pyx_k_A_A_Za_z__1_w_Z, sizeof(__pyx_k_A_A_Za_z__1_w_Z), 0, 1, 0, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
  {&__pyx_n_s_BOLD, __pyx_k_BOLD, sizeof(__pyx_k_BOLD), 0, 0, 1, 1},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_kp_u_CALLABLE_Yes, __pyx_k_CALLABLE_Yes, sizeof(__pyx_k_CALLABLE_Yes), 0, 1, 0, 0},
  {&__pyx_kp_u_CALLABLE_no, __pyx_k_CALLABLE_no, sizeof(__pyx_k_CALLABLE_no), 0, 1, 0, 0},
  {&__pyx_kp_u_CLASS, __pyx_k_CLASS, sizeof(__pyx_k_CLASS), 0, 1, 0, 0},
  {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1},
  {&__pyx_n_s_CheckFile, __pyx_k_CheckFile, sizeof(__pyx_k_CheckFile), 0, 0, 1, 1},
  {&__pyx_n_s_ConfigParser, __pyx_k_ConfigParser, sizeof(__pyx_k_ConfigParser), 0, 0, 1, 1},
  {&__pyx_n_s_ContainsAny, __pyx_k_ContainsAny, sizeof(__pyx_k_ContainsAny), 0, 0, 1, 1},
  {&__pyx_n_s_DEFAULTSECT, __pyx_k_DEFAULTSECT, sizeof(__pyx_k_DEFAULTSECT), 0, 0, 1, 1},
  {&__pyx_kp_u_DOC, __pyx_k_DOC, sizeof(__pyx_k_DOC), 0, 1, 0, 0},
  {&__pyx_kp_s_Dictionnaire_dont_la_valeur_par, __pyx_k_Dictionnaire_dont_la_valeur_par, sizeof(__pyx_k_Dictionnaire_dont_la_valeur_par), 0, 0, 1, 0},
  {&__pyx_kp_u_Dimension_error, __pyx_k_Dimension_error, sizeof(__pyx_k_Dimension_error), 0, 1, 0, 0},
  {&__pyx_n_s_ENDC, __pyx_k_ENDC, sizeof(__pyx_k_ENDC), 0, 0, 1, 1},
  {&__pyx_kp_u_Error_in_calling_script_s, __pyx_k_Error_in_calling_script_s, sizeof(__pyx_k_Error_in_calling_script_s), 0, 1, 0, 0},
  {&__pyx_n_s_FAIL, __pyx_k_FAIL, sizeof(__pyx_k_FAIL), 0, 0, 1, 1},
  {&__pyx_n_s_FalseToEmpty, __pyx_k_FalseToEmpty, sizeof(__pyx_k_FalseToEmpty), 0, 0, 1, 1},
  {&__pyx_n_s_Fct, __pyx_k_Fct, sizeof(__pyx_k_Fct), 0, 0, 1, 1},
  {&__pyx_n_s_FullFileName, __pyx_k_FullFileName, sizeof(__pyx_k_FullFileName), 0, 0, 1, 1},
  {&__pyx_n_s_Func, __pyx_k_Func, sizeof(__pyx_k_Func), 0, 0, 1, 1},
  {&__pyx_n_s_GetAsString, __pyx_k_GetAsString, sizeof(__pyx_k_GetAsString), 0, 0, 1, 1},
  {&__pyx_n_s_GetDefaultStyle, __pyx_k_GetDefaultStyle, sizeof(__pyx_k_GetDefaultStyle), 0, 0, 1, 1},
  {&__pyx_n_s_HEADER, __pyx_k_HEADER, sizeof(__pyx_k_HEADER), 0, 0, 1, 1},
  {&__pyx_kp_u_H_M, __pyx_k_H_M, sizeof(__pyx_k_H_M), 0, 1, 0, 0},
  {&__pyx_kp_u_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_IndexValueError, __pyx_k_IndexValueError, sizeof(__pyx_k_IndexValueError), 0, 0, 1, 1},
  {&__pyx_n_s_IndexValueError___init, __pyx_k_IndexValueError___init, sizeof(__pyx_k_IndexValueError___init), 0, 0, 1, 1},
  {&__pyx_n_s_IndexValueError_lambda, __pyx_k_IndexValueError_lambda, sizeof(__pyx_k_IndexValueError_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_InsertionPoint, __pyx_k_InsertionPoint, sizeof(__pyx_k_InsertionPoint), 0, 0, 1, 1},
  {&__pyx_n_s_IsOk, __pyx_k_IsOk, sizeof(__pyx_k_IsOk), 0, 0, 1, 1},
  {&__pyx_n_s_IsValidHour, __pyx_k_IsValidHour, sizeof(__pyx_k_IsValidHour), 0, 0, 1, 1},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_u_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 1, 0, 0},
  {&__pyx_kp_u_Library_Python_s_site_packages, __pyx_k_Library_Python_s_site_packages, sizeof(__pyx_k_Library_Python_s_site_packages), 0, 1, 0, 0},
  {&__pyx_n_s_LoadConfig, __pyx_k_LoadConfig, sizeof(__pyx_k_LoadConfig), 0, 0, 1, 1},
  {&__pyx_kp_u_MonaEx70_dll, __pyx_k_MonaEx70_dll, sizeof(__pyx_k_MonaEx70_dll), 0, 1, 0, 0},
  {&__pyx_kp_u_Monaex70__d_dll, __pyx_k_Monaex70__d_dll, sizeof(__pyx_k_Monaex70__d_dll), 0, 1, 0, 0},
  {&__pyx_kp_u_NAME, __pyx_k_NAME, sizeof(__pyx_k_NAME), 0, 1, 0, 0},
  {&__pyx_n_s_NDKdllName, __pyx_k_NDKdllName, sizeof(__pyx_k_NDKdllName), 0, 0, 1, 1},
  {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1},
  {&__pyx_n_s_NoSectionError, __pyx_k_NoSectionError, sizeof(__pyx_k_NoSectionError), 0, 0, 1, 1},
  {&__pyx_n_s_OK, __pyx_k_OK, sizeof(__pyx_k_OK), 0, 0, 1, 1},
  {&__pyx_n_s_OKBLUE, __pyx_k_OKBLUE, sizeof(__pyx_k_OKBLUE), 0, 0, 1, 1},
  {&__pyx_n_s_OKGREEN, __pyx_k_OKGREEN, sizeof(__pyx_k_OKGREEN), 0, 0, 1, 1},
  {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
  {&__pyx_n_s_PIPE, __pyx_k_PIPE, sizeof(__pyx_k_PIPE), 0, 0, 1, 1},
  {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  {&__pyx_n_u_PYTHONPATH, __pyx_k_PYTHONPATH, sizeof(__pyx_k_PYTHONPATH), 0, 1, 0, 1},
  {&__pyx_n_s_Popen, __pyx_k_Popen, sizeof(__pyx_k_Popen), 0, 0, 1, 1},
  {&__pyx_n_s_PrettyPrintDic, __pyx_k_PrettyPrintDic, sizeof(__pyx_k_PrettyPrintDic), 0, 0, 1, 1},
  {&__pyx_n_s_PrettyPrintDic_locals_genexpr, __pyx_k_PrettyPrintDic_locals_genexpr, sizeof(__pyx_k_PrettyPrintDic_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_u_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 1, 0, 1},
  {&__pyx_n_s_RawConfigParser, __pyx_k_RawConfigParser, sizeof(__pyx_k_RawConfigParser), 0, 0, 1, 1},
  {&__pyx_n_s_RegFile, __pyx_k_RegFile, sizeof(__pyx_k_RegFile), 0, 0, 1, 1},
  {&__pyx_n_s_SafeConfigParser, __pyx_k_SafeConfigParser, sizeof(__pyx_k_SafeConfigParser), 0, 0, 1, 1},
  {&__pyx_n_s_SetDefaultStyle, __pyx_k_SetDefaultStyle, sizeof(__pyx_k_SetDefaultStyle), 0, 0, 1, 1},
  {&__pyx_n_s_SetTextColour, __pyx_k_SetTextColour, sizeof(__pyx_k_SetTextColour), 0, 0, 1, 1},
  {&__pyx_n_s_ShowPosition, __pyx_k_ShowPosition, sizeof(__pyx_k_ShowPosition), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_SystemExit, __pyx_k_SystemExit, sizeof(__pyx_k_SystemExit), 0, 0, 1, 1},
  {&__pyx_n_s_TCR_NOSORT, __pyx_k_TCR_NOSORT, sizeof(__pyx_k_TCR_NOSORT), 0, 0, 1, 1},
  {&__pyx_kp_u_TYPE, __pyx_k_TYPE, sizeof(__pyx_k_TYPE), 0, 1, 0, 0},
  {&__pyx_n_s_TextColour, __pyx_k_TextColour, sizeof(__pyx_k_TextColour), 0, 0, 1, 1},
  {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
  {&__pyx_n_u_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 1, 0, 1},
  {&__pyx_n_s_TrueToEmpty, __pyx_k_TrueToEmpty, sizeof(__pyx_k_TrueToEmpty), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_UNDERLINE, __pyx_k_UNDERLINE, sizeof(__pyx_k_UNDERLINE), 0, 0, 1, 1},
  {&__pyx_kp_u_VALUE, __pyx_k_VALUE, sizeof(__pyx_k_VALUE), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WARNING, __pyx_k_WARNING, sizeof(__pyx_k_WARNING), 0, 0, 1, 1},
  {&__pyx_n_s_WriteImage, __pyx_k_WriteImage, sizeof(__pyx_k_WriteImage), 0, 0, 1, 1},
  {&__pyx_n_s_WriteText, __pyx_k_WriteText, sizeof(__pyx_k_WriteText), 0, 0, 1, 1},
  {&__pyx_kp_u__100, __pyx_k__100, sizeof(__pyx_k__100), 0, 1, 0, 0},
  {&__pyx_n_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 1},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
  {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0},
  {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
  {&__pyx_kp_u__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 1, 0, 0},
  {&__pyx_kp_u__56, __pyx_k__56, sizeof(__pyx_k__56), 0, 1, 0, 0},
  {&__pyx_kp_u__58, __pyx_k__58, sizeof(__pyx_k__58), 0, 1, 0, 0},
  {&__pyx_kp_u__66, __pyx_k__66, sizeof(__pyx_k__66), 0, 1, 0, 0},
  {&__pyx_kp_u__67, __pyx_k__67, sizeof(__pyx_k__67), 0, 1, 0, 0},
  {&__pyx_n_s__70, __pyx_k__70, sizeof(__pyx_k__70), 0, 0, 1, 1},
  {&__pyx_n_u__70, __pyx_k__70, sizeof(__pyx_k__70), 0, 1, 0, 1},
  {&__pyx_kp_u__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 1, 0, 0},
  {&__pyx_kp_u__86, __pyx_k__86, sizeof(__pyx_k__86), 0, 1, 0, 0},
  {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0},
  {&__pyx_kp_u__88, __pyx_k__88, sizeof(__pyx_k__88), 0, 1, 0, 0},
  {&__pyx_kp_u__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 1, 0, 0},
  {&__pyx_kp_u__90, __pyx_k__90, sizeof(__pyx_k__90), 0, 1, 0, 0},
  {&__pyx_kp_u__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 1, 0, 0},
  {&__pyx_kp_u__92, __pyx_k__92, sizeof(__pyx_k__92), 0, 1, 0, 0},
  {&__pyx_kp_u__93, __pyx_k__93, sizeof(__pyx_k__93), 0, 1, 0, 0},
  {&__pyx_kp_u__94, __pyx_k__94, sizeof(__pyx_k__94), 0, 1, 0, 0},
  {&__pyx_kp_u__95, __pyx_k__95, sizeof(__pyx_k__95), 0, 1, 0, 0},
  {&__pyx_kp_u__96, __pyx_k__96, sizeof(__pyx_k__96), 0, 1, 0, 0},
  {&__pyx_kp_u__97, __pyx_k__97, sizeof(__pyx_k__97), 0, 1, 0, 0},
  {&__pyx_kp_u__98, __pyx_k__98, sizeof(__pyx_k__98), 0, 1, 0, 0},
  {&__pyx_kp_u__99, __pyx_k__99, sizeof(__pyx_k__99), 0, 1, 0, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_u_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0, 1},
  {&__pyx_kp_u_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 1, 0, 0},
  {&__pyx_n_s_absmax, __pyx_k_absmax, sizeof(__pyx_k_absmax), 0, 0, 1, 1},
  {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_add2path, __pyx_k_add2path, sizeof(__pyx_k_add2path), 0, 0, 1, 1},
  {&__pyx_n_s_addPythonPath, __pyx_k_addPythonPath, sizeof(__pyx_k_addPythonPath), 0, 0, 1, 1},
  {&__pyx_n_s_addToFileName, __pyx_k_addToFileName, sizeof(__pyx_k_addToFileName), 0, 0, 1, 1},
  {&__pyx_n_s_add_section, __pyx_k_add_section, sizeof(__pyx_k_add_section), 0, 0, 1, 1},
  {&__pyx_n_s_addpathlist, __pyx_k_addpathlist, sizeof(__pyx_k_addpathlist), 0, 0, 1, 1},
  {&__pyx_n_s_addstr, __pyx_k_addstr, sizeof(__pyx_k_addstr), 0, 0, 1, 1},
  {&__pyx_n_s_adduniqueline, __pyx_k_adduniqueline, sizeof(__pyx_k_adduniqueline), 0, 0, 1, 1},
  {&__pyx_n_s_aleastr, __pyx_k_aleastr, sizeof(__pyx_k_aleastr), 0, 0, 1, 1},
  {&__pyx_n_s_alevel, __pyx_k_alevel, sizeof(__pyx_k_alevel), 0, 0, 1, 1},
  {&__pyx_n_s_alllist, __pyx_k_alllist, sizeof(__pyx_k_alllist), 0, 0, 1, 1},
  {&__pyx_n_s_analyserange, __pyx_k_analyserange, sizeof(__pyx_k_analyserange), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_appendex, __pyx_k_appendex, sizeof(__pyx_k_appendex), 0, 0, 1, 1},
  {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_argv, __pyx_k_argv, sizeof(__pyx_k_argv), 0, 0, 1, 1},
  {&__pyx_n_s_aset, __pyx_k_aset, sizeof(__pyx_k_aset), 0, 0, 1, 1},
  {&__pyx_n_s_aslice, __pyx_k_aslice, sizeof(__pyx_k_aslice), 0, 0, 1, 1},
  {&__pyx_n_s_autoprop, __pyx_k_autoprop, sizeof(__pyx_k_autoprop), 0, 0, 1, 1},
  {&__pyx_n_s_autoprop___init, __pyx_k_autoprop___init, sizeof(__pyx_k_autoprop___init), 0, 0, 1, 1},
  {&__pyx_n_s_autoprop___init___locals_genexpr, __pyx_k_autoprop___init___locals_genexpr, sizeof(__pyx_k_autoprop___init___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_kp_s_autoprop_metaclasse_definissant, __pyx_k_autoprop_metaclasse_definissant, sizeof(__pyx_k_autoprop_metaclasse_definissant), 0, 0, 1, 0},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_kp_u_b_2, __pyx_k_b_2, sizeof(__pyx_k_b_2), 0, 1, 0, 0},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_bcolors, __pyx_k_bcolors, sizeof(__pyx_k_bcolors), 0, 0, 1, 1},
  {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1},
  {&__pyx_n_s_binaries_directory, __pyx_k_binaries_directory, sizeof(__pyx_k_binaries_directory), 0, 0, 1, 1},
  {&__pyx_n_s_binaries_directory_locals_genexp, __pyx_k_binaries_directory_locals_genexp, sizeof(__pyx_k_binaries_directory_locals_genexp), 0, 0, 1, 1},
  {&__pyx_n_u_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 1, 0, 1},
  {&__pyx_n_s_blank, __pyx_k_blank, sizeof(__pyx_k_blank), 0, 0, 1, 1},
  {&__pyx_n_s_boolstr, __pyx_k_boolstr, sizeof(__pyx_k_boolstr), 0, 0, 1, 1},
  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
  {&__pyx_n_s_byref, __pyx_k_byref, sizeof(__pyx_k_byref), 0, 0, 1, 1},
  {&__pyx_kp_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 0},
  {&__pyx_n_s_cValues, __pyx_k_cValues, sizeof(__pyx_k_cValues), 0, 0, 1, 1},
  {&__pyx_n_s_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 1, 1},
  {&__pyx_kp_u_c_3, __pyx_k_c_3, sizeof(__pyx_k_c_3), 0, 1, 0, 0},
  {&__pyx_n_s_c_char, __pyx_k_c_char, sizeof(__pyx_k_c_char), 0, 0, 1, 1},
  {&__pyx_n_s_c_double, __pyx_k_c_double, sizeof(__pyx_k_c_double), 0, 0, 1, 1},
  {&__pyx_n_s_cached_listdir, __pyx_k_cached_listdir, sizeof(__pyx_k_cached_listdir), 0, 0, 1, 1},
  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  {&__pyx_n_s_candidate, __pyx_k_candidate, sizeof(__pyx_k_candidate), 0, 0, 1, 1},
  {&__pyx_n_s_caseSensitive, __pyx_k_caseSensitive, sizeof(__pyx_k_caseSensitive), 0, 0, 1, 1},
  {&__pyx_n_s_casesensitive, __pyx_k_casesensitive, sizeof(__pyx_k_casesensitive), 0, 0, 1, 1},
  {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
  {&__pyx_n_s_checkFile, __pyx_k_checkFile, sizeof(__pyx_k_checkFile), 0, 0, 1, 1},
  {&__pyx_n_s_checkIndex, __pyx_k_checkIndex, sizeof(__pyx_k_checkIndex), 0, 0, 1, 1},
  {&__pyx_n_s_chemin, __pyx_k_chemin, sizeof(__pyx_k_chemin), 0, 0, 1, 1},
  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
  {&__pyx_n_s_cible, __pyx_k_cible, sizeof(__pyx_k_cible), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_u_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 1, 0, 1},
  {&__pyx_n_s_cleanDir, __pyx_k_cleanDir, sizeof(__pyx_k_cleanDir), 0, 0, 1, 1},
  {&__pyx_n_s_cleanfiles, __pyx_k_cleanfiles, sizeof(__pyx_k_cleanfiles), 0, 0, 1, 1},
  {&__pyx_n_s_cleanfiles_locals_lambda, __pyx_k_cleanfiles_locals_lambda, sizeof(__pyx_k_cleanfiles_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key, __pyx_k_cmp_to_key, sizeof(__pyx_k_cmp_to_key), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K, __pyx_k_cmp_to_key_locals_K, sizeof(__pyx_k_cmp_to_key_locals_K), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___eq, __pyx_k_cmp_to_key_locals_K___eq, sizeof(__pyx_k_cmp_to_key_locals_K___eq), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___ge, __pyx_k_cmp_to_key_locals_K___ge, sizeof(__pyx_k_cmp_to_key_locals_K___ge), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___gt, __pyx_k_cmp_to_key_locals_K___gt, sizeof(__pyx_k_cmp_to_key_locals_K___gt), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___init, __pyx_k_cmp_to_key_locals_K___init, sizeof(__pyx_k_cmp_to_key_locals_K___init), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___le, __pyx_k_cmp_to_key_locals_K___le, sizeof(__pyx_k_cmp_to_key_locals_K___le), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___lt, __pyx_k_cmp_to_key_locals_K___lt, sizeof(__pyx_k_cmp_to_key_locals_K___lt), 0, 0, 1, 1},
  {&__pyx_n_s_cmp_to_key_locals_K___ne, __pyx_k_cmp_to_key_locals_K___ne, sizeof(__pyx_k_cmp_to_key_locals_K___ne), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_colmem, __pyx_k_colmem, sizeof(__pyx_k_colmem), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_n_u_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 1, 0, 1},
  {&__pyx_n_s_communicate, __pyx_k_communicate, sizeof(__pyx_k_communicate), 0, 0, 1, 1},
  {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_configfile, __pyx_k_configfile, sizeof(__pyx_k_configfile), 0, 0, 1, 1},
  {&__pyx_n_s_configparser, __pyx_k_configparser, sizeof(__pyx_k_configparser), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1},
  {&__pyx_n_s_createAleaTable, __pyx_k_createAleaTable, sizeof(__pyx_k_createAleaTable), 0, 0, 1, 1},
  {&__pyx_kp_u_creating_s, __pyx_k_creating_s, sizeof(__pyx_k_creating_s), 0, 1, 0, 0},
  {&__pyx_n_s_criterion, __pyx_k_criterion, sizeof(__pyx_k_criterion), 0, 0, 1, 1},
  {&__pyx_n_u_criterion, __pyx_k_criterion, sizeof(__pyx_k_criterion), 0, 1, 0, 1},
  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
  {&__pyx_kp_u_d_Z, __pyx_k_d_Z, sizeof(__pyx_k_d_Z), 0, 1, 0, 0},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_dataIterator, __pyx_k_dataIterator, sizeof(__pyx_k_dataIterator), 0, 0, 1, 1},
  {&__pyx_n_s_date0, __pyx_k_date0, sizeof(__pyx_k_date0), 0, 0, 1, 1},
  {&__pyx_n_s_datelong, __pyx_k_datelong, sizeof(__pyx_k_datelong), 0, 0, 1, 1},
  {&__pyx_n_s_datelong_locals_setlen2, __pyx_k_datelong_locals_setlen2, sizeof(__pyx_k_datelong_locals_setlen2), 0, 0, 1, 1},
  {&__pyx_n_s_datelst, __pyx_k_datelst, sizeof(__pyx_k_datelst), 0, 0, 1, 1},
  {&__pyx_n_s_datestr, __pyx_k_datestr, sizeof(__pyx_k_datestr), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_defaultedConfigParser, __pyx_k_defaultedConfigParser, sizeof(__pyx_k_defaultedConfigParser), 0, 0, 1, 1},
  {&__pyx_n_s_defconf, __pyx_k_defconf, sizeof(__pyx_k_defconf), 0, 0, 1, 1},
  {&__pyx_n_u_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 1, 0, 1},
  {&__pyx_kp_u_del__s, __pyx_k_del__s, sizeof(__pyx_k_del__s), 0, 1, 0, 0},
  {&__pyx_n_s_deletefilebyFonction, __pyx_k_deletefilebyFonction, sizeof(__pyx_k_deletefilebyFonction), 0, 0, 1, 1},
  {&__pyx_n_s_deletefilebyFonction_locals_lamb, __pyx_k_deletefilebyFonction_locals_lamb, sizeof(__pyx_k_deletefilebyFonction_locals_lamb), 0, 0, 1, 1},
  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
  {&__pyx_n_s_dic, __pyx_k_dic, sizeof(__pyx_k_dic), 0, 0, 1, 1},
  {&__pyx_n_s_dico, __pyx_k_dico, sizeof(__pyx_k_dico), 0, 0, 1, 1},
  {&__pyx_n_s_dico2, __pyx_k_dico2, sizeof(__pyx_k_dico2), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
  {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1},
  {&__pyx_n_s_dir_path, __pyx_k_dir_path, sizeof(__pyx_k_dir_path), 0, 0, 1, 1},
  {&__pyx_n_s_direct, __pyx_k_direct, sizeof(__pyx_k_direct), 0, 0, 1, 1},
  {&__pyx_n_s_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1},
  {&__pyx_n_s_direxists, __pyx_k_direxists, sizeof(__pyx_k_direxists), 0, 0, 1, 1},
  {&__pyx_n_s_dirloc, __pyx_k_dirloc, sizeof(__pyx_k_dirloc), 0, 0, 1, 1},
  {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  {&__pyx_n_s_dirr, __pyx_k_dirr, sizeof(__pyx_k_dirr), 0, 0, 1, 1},
  {&__pyx_n_s_dirs, __pyx_k_dirs, sizeof(__pyx_k_dirs), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 0, 1},
  {&__pyx_n_u_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 1, 0, 1},
  {&__pyx_n_s_doc_3, __pyx_k_doc_3, sizeof(__pyx_k_doc_3), 0, 0, 1, 1},
  {&__pyx_kp_u_doc__s, __pyx_k_doc__s, sizeof(__pyx_k_doc__s), 0, 1, 0, 0},
  {&__pyx_n_s_doprint, __pyx_k_doprint, sizeof(__pyx_k_doprint), 0, 0, 1, 1},
  {&__pyx_n_s_dothread, __pyx_k_dothread, sizeof(__pyx_k_dothread), 0, 0, 1, 1},
  {&__pyx_n_s_dothread_locals_wrapper, __pyx_k_dothread_locals_wrapper, sizeof(__pyx_k_dothread_locals_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_dupescape, __pyx_k_dupescape, sizeof(__pyx_k_dupescape), 0, 0, 1, 1},
  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
  {&__pyx_n_s_epochs, __pyx_k_epochs, sizeof(__pyx_k_epochs), 0, 0, 1, 1},
  {&__pyx_n_u_epochs, __pyx_k_epochs, sizeof(__pyx_k_epochs), 0, 1, 0, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
  {&__pyx_n_s_escape_dict, __pyx_k_escape_dict, sizeof(__pyx_k_escape_dict), 0, 0, 1, 1},
  {&__pyx_n_s_estimatedstr, __pyx_k_estimatedstr, sizeof(__pyx_k_estimatedstr), 0, 0, 1, 1},
  {&__pyx_n_s_exec_prefix, __pyx_k_exec_prefix, sizeof(__pyx_k_exec_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1},
  {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_kp_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 0},
  {&__pyx_n_s_f_2, __pyx_k_f_2, sizeof(__pyx_k_f_2), 0, 0, 1, 1},
  {&__pyx_n_s_fdel, __pyx_k_fdel, sizeof(__pyx_k_fdel), 0, 0, 1, 1},
  {&__pyx_n_s_fdoc, __pyx_k_fdoc, sizeof(__pyx_k_fdoc), 0, 0, 1, 1},
  {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1},
  {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1},
  {&__pyx_kp_u_file_s_does_not_exists, __pyx_k_file_s_does_not_exists, sizeof(__pyx_k_file_s_does_not_exists), 0, 1, 0, 0},
  {&__pyx_n_s_fileexists, __pyx_k_fileexists, sizeof(__pyx_k_fileexists), 0, 0, 1, 1},
  {&__pyx_n_s_filelist, __pyx_k_filelist, sizeof(__pyx_k_filelist), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_filename2, __pyx_k_filename2, sizeof(__pyx_k_filename2), 0, 0, 1, 1},
  {&__pyx_n_s_files, __pyx_k_files, sizeof(__pyx_k_files), 0, 0, 1, 1},
  {&__pyx_n_s_filesource, __pyx_k_filesource, sizeof(__pyx_k_filesource), 0, 0, 1, 1},
  {&__pyx_n_s_fillchar, __pyx_k_fillchar, sizeof(__pyx_k_fillchar), 0, 0, 1, 1},
  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
  {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1},
  {&__pyx_n_s_firstline, __pyx_k_firstline, sizeof(__pyx_k_firstline), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1},
  {&__pyx_n_s_forbidden, __pyx_k_forbidden, sizeof(__pyx_k_forbidden), 0, 0, 1, 1},
  {&__pyx_n_s_fset, __pyx_k_fset, sizeof(__pyx_k_fset), 0, 0, 1, 1},
  {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
  {&__pyx_n_s_fullFileName, __pyx_k_fullFileName, sizeof(__pyx_k_fullFileName), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get2indexstr, __pyx_k_get2indexstr, sizeof(__pyx_k_get2indexstr), 0, 0, 1, 1},
  {&__pyx_n_s_getCVector, __pyx_k_getCVector, sizeof(__pyx_k_getCVector), 0, 0, 1, 1},
  {&__pyx_n_s_getFilesByExt, __pyx_k_getFilesByExt, sizeof(__pyx_k_getFilesByExt), 0, 0, 1, 1},
  {&__pyx_n_s_getIndexInVector, __pyx_k_getIndexInVector, sizeof(__pyx_k_getIndexInVector), 0, 0, 1, 1},
  {&__pyx_n_s_getOptions, __pyx_k_getOptions, sizeof(__pyx_k_getOptions), 0, 0, 1, 1},
  {&__pyx_n_s_getPythonPath, __pyx_k_getPythonPath, sizeof(__pyx_k_getPythonPath), 0, 0, 1, 1},
  {&__pyx_n_u_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 1, 0, 1},
  {&__pyx_kp_u_get__s, __pyx_k_get__s, sizeof(__pyx_k_get__s), 0, 1, 0, 0},
  {&__pyx_n_s_getconfigfile, __pyx_k_getconfigfile, sizeof(__pyx_k_getconfigfile), 0, 0, 1, 1},
  {&__pyx_n_s_getexecparam, __pyx_k_getexecparam, sizeof(__pyx_k_getexecparam), 0, 0, 1, 1},
  {&__pyx_n_s_getfiletype, __pyx_k_getfiletype, sizeof(__pyx_k_getfiletype), 0, 0, 1, 1},
  {&__pyx_n_s_getindexstr, __pyx_k_getindexstr, sizeof(__pyx_k_getindexstr), 0, 0, 1, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_gettempdir, __pyx_k_gettempdir, sizeof(__pyx_k_gettempdir), 0, 0, 1, 1},
  {&__pyx_n_s_getusersitepackages, __pyx_k_getusersitepackages, sizeof(__pyx_k_getusersitepackages), 0, 0, 1, 1},
  {&__pyx_n_s_global_cache, __pyx_k_global_cache, sizeof(__pyx_k_global_cache), 0, 0, 1, 1},
  {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1},
  {&__pyx_n_s_hasBoolValue, __pyx_k_hasBoolValue, sizeof(__pyx_k_hasBoolValue), 0, 0, 1, 1},
  {&__pyx_n_s_has_section, __pyx_k_has_section, sizeof(__pyx_k_has_section), 0, 0, 1, 1},
  {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
  {&__pyx_n_s_hexstrtoint, __pyx_k_hexstrtoint, sizeof(__pyx_k_hexstrtoint), 0, 0, 1, 1},
  {&__pyx_n_s_homedir, __pyx_k_homedir, sizeof(__pyx_k_homedir), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_idemDefaultDict, __pyx_k_idemDefaultDict, sizeof(__pyx_k_idemDefaultDict), 0, 0, 1, 1},
  {&__pyx_n_s_idemDefaultDict___getitem, __pyx_k_idemDefaultDict___getitem, sizeof(__pyx_k_idemDefaultDict___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_idemDefaultDict___init, __pyx_k_idemDefaultDict___init, sizeof(__pyx_k_idemDefaultDict___init), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_index1, __pyx_k_index1, sizeof(__pyx_k_index1), 0, 0, 1, 1},
  {&__pyx_n_s_index2, __pyx_k_index2, sizeof(__pyx_k_index2), 0, 0, 1, 1},
  {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_initCount, __pyx_k_initCount, sizeof(__pyx_k_initCount), 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_original, __pyx_k_init_original, sizeof(__pyx_k_init_original), 0, 0, 1, 1},
  {&__pyx_n_u_initialization, __pyx_k_initialization, sizeof(__pyx_k_initialization), 0, 1, 0, 1},
  {&__pyx_n_s_initstddev, __pyx_k_initstddev, sizeof(__pyx_k_initstddev), 0, 0, 1, 1},
  {&__pyx_n_u_initstddev, __pyx_k_initstddev, sizeof(__pyx_k_initstddev), 0, 1, 0, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_instance, __pyx_k_instance, sizeof(__pyx_k_instance), 0, 0, 1, 1},
  {&__pyx_n_s_inter, __pyx_k_inter, sizeof(__pyx_k_inter), 0, 0, 1, 1},
  {&__pyx_n_s_interrogate, __pyx_k_interrogate, sizeof(__pyx_k_interrogate), 0, 0, 1, 1},
  {&__pyx_n_s_intro, __pyx_k_intro, sizeof(__pyx_k_intro), 0, 0, 1, 1},
  {&__pyx_n_s_inttohexstr, __pyx_k_inttohexstr, sizeof(__pyx_k_inttohexstr), 0, 0, 1, 1},
  {&__pyx_n_s_isdir, __pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 0, 1, 1},
  {&__pyx_n_s_isfield, __pyx_k_isfield, sizeof(__pyx_k_isfield), 0, 0, 1, 1},
  {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  {&__pyx_n_s_isiterable, __pyx_k_isiterable, sizeof(__pyx_k_isiterable), 0, 0, 1, 1},
  {&__pyx_n_s_isnum, __pyx_k_isnum, sizeof(__pyx_k_isnum), 0, 0, 1, 1},
  {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1},
  {&__pyx_n_u_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 1, 0, 1},
  {&__pyx_n_s_it_2, __pyx_k_it_2, sizeof(__pyx_k_it_2), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iterable, __pyx_k_iterable, sizeof(__pyx_k_iterable), 0, 0, 1, 1},
  {&__pyx_n_s_iterator, __pyx_k_iterator, sizeof(__pyx_k_iterator), 0, 0, 1, 1},
  {&__pyx_n_s_iterlist, __pyx_k_iterlist, sizeof(__pyx_k_iterlist), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_joinEx, __pyx_k_joinEx, sizeof(__pyx_k_joinEx), 0, 0, 1, 1},
  {&__pyx_n_s_joinEx_locals_genexpr, __pyx_k_joinEx_locals_genexpr, sizeof(__pyx_k_joinEx_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_joinEx_locals_modifiedstr, __pyx_k_joinEx_locals_modifiedstr, sizeof(__pyx_k_joinEx_locals_modifiedstr), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
  {&__pyx_n_s_kwarg, __pyx_k_kwarg, sizeof(__pyx_k_kwarg), 0, 0, 1, 1},
  {&__pyx_n_s_kwd, __pyx_k_kwd, sizeof(__pyx_k_kwd), 0, 0, 1, 1},
  {&__pyx_n_s_kwds, __pyx_k_kwds, sizeof(__pyx_k_kwds), 0, 0, 1, 1},
  {&__pyx_kp_u_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 1, 0, 0},
  {&__pyx_n_s_l_2, __pyx_k_l_2, sizeof(__pyx_k_l_2), 0, 0, 1, 1},
  {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_levelmax, __pyx_k_levelmax, sizeof(__pyx_k_levelmax), 0, 0, 1, 1},
  {&__pyx_n_s_lf, __pyx_k_lf, sizeof(__pyx_k_lf), 0, 0, 1, 1},
  {&__pyx_kp_u_lib_python_s_dist_packages, __pyx_k_lib_python_s_dist_packages, sizeof(__pyx_k_lib_python_s_dist_packages), 0, 1, 0, 0},
  {&__pyx_kp_u_lib_python_s_site_packages, __pyx_k_lib_python_s_site_packages, sizeof(__pyx_k_lib_python_s_site_packages), 0, 1, 0, 0},
  {&__pyx_n_s_lim, __pyx_k_lim, sizeof(__pyx_k_lim), 0, 0, 1, 1},
  {&__pyx_n_s_limited, __pyx_k_limited, sizeof(__pyx_k_limited), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_u_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 1, 0, 1},
  {&__pyx_n_s_linker, __pyx_k_linker, sizeof(__pyx_k_linker), 0, 0, 1, 1},
  {&__pyx_n_s_linkstr, __pyx_k_linkstr, sizeof(__pyx_k_linkstr), 0, 0, 1, 1},
  {&__pyx_n_s_listdir, __pyx_k_listdir, sizeof(__pyx_k_listdir), 0, 0, 1, 1},
  {&__pyx_n_s_listorint, __pyx_k_listorint, sizeof(__pyx_k_listorint), 0, 0, 1, 1},
  {&__pyx_n_s_listorstr, __pyx_k_listorstr, sizeof(__pyx_k_listorstr), 0, 0, 1, 1},
  {&__pyx_n_s_ljust, __pyx_k_ljust, sizeof(__pyx_k_ljust), 0, 0, 1, 1},
  {&__pyx_n_s_ll, __pyx_k_ll, sizeof(__pyx_k_ll), 0, 0, 1, 1},
  {&__pyx_n_s_llist, __pyx_k_llist, sizeof(__pyx_k_llist), 0, 0, 1, 1},
  {&__pyx_n_s_lmin, __pyx_k_lmin, sizeof(__pyx_k_lmin), 0, 0, 1, 1},
  {&__pyx_kp_u_local_lib_python_s_dist_package, __pyx_k_local_lib_python_s_dist_package, sizeof(__pyx_k_local_lib_python_s_dist_package), 0, 1, 0, 0},
  {&__pyx_kp_u_local_lib_python_s_site_package, __pyx_k_local_lib_python_s_site_package, sizeof(__pyx_k_local_lib_python_s_site_package), 0, 1, 0, 0},
  {&__pyx_n_s_locationpath, __pyx_k_locationpath, sizeof(__pyx_k_locationpath), 0, 0, 1, 1},
  {&__pyx_n_s_lookForFile, __pyx_k_lookForFile, sizeof(__pyx_k_lookForFile), 0, 0, 1, 1},
  {&__pyx_n_s_lookInTree, __pyx_k_lookInTree, sizeof(__pyx_k_lookInTree), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1},
  {&__pyx_n_s_lst2, __pyx_k_lst2, sizeof(__pyx_k_lst2), 0, 0, 1, 1},
  {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_u_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 1, 0, 1},
  {&__pyx_n_s_make_dir, __pyx_k_make_dir, sizeof(__pyx_k_make_dir), 0, 0, 1, 1},
  {&__pyx_n_s_makedirs, __pyx_k_makedirs, sizeof(__pyx_k_makedirs), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_maxexcluded, __pyx_k_maxexcluded, sizeof(__pyx_k_maxexcluded), 0, 0, 1, 1},
  {&__pyx_n_s_mem, __pyx_k_mem, sizeof(__pyx_k_mem), 0, 0, 1, 1},
  {&__pyx_n_s_mess, __pyx_k_mess, sizeof(__pyx_k_mess), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metaphor_monal_util_toolbox, __pyx_k_metaphor_monal_util_toolbox, sizeof(__pyx_k_metaphor_monal_util_toolbox), 0, 0, 1, 1},
  {&__pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_k_metaphor_monal_util_toolbox_py, sizeof(__pyx_k_metaphor_monal_util_toolbox_py), 0, 0, 1, 0},
  {&__pyx_n_s_minincluded, __pyx_k_minincluded, sizeof(__pyx_k_minincluded), 0, 0, 1, 1},
  {&__pyx_n_s_modifiedstr, __pyx_k_modifiedstr, sizeof(__pyx_k_modifiedstr), 0, 0, 1, 1},
  {&__pyx_n_s_modname, __pyx_k_modname, sizeof(__pyx_k_modname), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_n_s_monalconst, __pyx_k_monalconst, sizeof(__pyx_k_monalconst), 0, 0, 1, 1},
  {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
  {&__pyx_n_s_mycmp, __pyx_k_mycmp, sizeof(__pyx_k_mycmp), 0, 0, 1, 1},
  {&__pyx_n_s_mydir, __pyx_k_mydir, sizeof(__pyx_k_mydir), 0, 0, 1, 1},
  {&__pyx_n_s_myfile, __pyx_k_myfile, sizeof(__pyx_k_myfile), 0, 0, 1, 1},
  {&__pyx_n_s_mytest, __pyx_k_mytest, sizeof(__pyx_k_mytest), 0, 0, 1, 1},
  {&__pyx_kp_u_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 1, 0, 0},
  {&__pyx_n_s_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
  {&__pyx_n_s_namefromfilename, __pyx_k_namefromfilename, sizeof(__pyx_k_namefromfilename), 0, 0, 1, 1},
  {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_original, __pyx_k_new_original, sizeof(__pyx_k_new_original), 0, 0, 1, 1},
  {&__pyx_n_s_nl, __pyx_k_nl, sizeof(__pyx_k_nl), 0, 0, 1, 1},
  {&__pyx_n_s_nline, __pyx_k_nline, sizeof(__pyx_k_nline), 0, 0, 1, 1},
  {&__pyx_n_s_nntoolbox_configparsertoolbox, __pyx_k_nntoolbox_configparsertoolbox, sizeof(__pyx_k_nntoolbox_configparsertoolbox), 0, 0, 1, 1},
  {&__pyx_n_s_nntoolbox_utils, __pyx_k_nntoolbox_utils, sizeof(__pyx_k_nntoolbox_utils), 0, 0, 1, 1},
  {&__pyx_n_s_nonZeroToOne, __pyx_k_nonZeroToOne, sizeof(__pyx_k_nonZeroToOne), 0, 0, 1, 1},
  {&__pyx_n_s_normcase, __pyx_k_normcase, sizeof(__pyx_k_normcase), 0, 0, 1, 1},
  {&__pyx_n_s_normpath, __pyx_k_normpath, sizeof(__pyx_k_normpath), 0, 0, 1, 1},
  {&__pyx_n_s_nperline, __pyx_k_nperline, sizeof(__pyx_k_nperline), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_opt, __pyx_k_opt, sizeof(__pyx_k_opt), 0, 0, 1, 1},
  {&__pyx_n_s_optional, __pyx_k_optional, sizeof(__pyx_k_optional), 0, 0, 1, 1},
  {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1},
  {&__pyx_n_s_packagename, __pyx_k_packagename, sizeof(__pyx_k_packagename), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pathlist, __pyx_k_pathlist, sizeof(__pyx_k_pathlist), 0, 0, 1, 1},
  {&__pyx_n_s_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 0, 1, 1},
  {&__pyx_n_u_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 1, 0, 1},
  {&__pyx_n_s_paths_2, __pyx_k_paths_2, sizeof(__pyx_k_paths_2), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_print_2, __pyx_k_print_2, sizeof(__pyx_k_print_2), 0, 0, 1, 1},
  {&__pyx_n_s_printdoc, __pyx_k_printdoc, sizeof(__pyx_k_printdoc), 0, 0, 1, 1},
  {&__pyx_n_s_printnl, __pyx_k_printnl, sizeof(__pyx_k_printnl), 0, 0, 1, 1},
  {&__pyx_n_s_product, __pyx_k_product, sizeof(__pyx_k_product), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_propertyname, __pyx_k_propertyname, sizeof(__pyx_k_propertyname), 0, 0, 1, 1},
  {&__pyx_n_s_props, __pyx_k_props, sizeof(__pyx_k_props), 0, 0, 1, 1},
  {&__pyx_n_s_pth, __pyx_k_pth, sizeof(__pyx_k_pth), 0, 0, 1, 1},
  {&__pyx_n_s_py_version, __pyx_k_py_version, sizeof(__pyx_k_py_version), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_kp_u_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0, 0},
  {&__pyx_n_s_randint, __pyx_k_randint, sizeof(__pyx_k_randint), 0, 0, 1, 1},
  {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rangestr, __pyx_k_rangestr, sizeof(__pyx_k_rangestr), 0, 0, 1, 1},
  {&__pyx_n_s_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_recursive, __pyx_k_recursive, sizeof(__pyx_k_recursive), 0, 0, 1, 1},
  {&__pyx_n_s_regFile, __pyx_k_regFile, sizeof(__pyx_k_regFile), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_removelinewith, __pyx_k_removelinewith, sizeof(__pyx_k_removelinewith), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_resultdir, __pyx_k_resultdir, sizeof(__pyx_k_resultdir), 0, 0, 1, 1},
  {&__pyx_n_u_resultdirectory, __pyx_k_resultdirectory, sizeof(__pyx_k_resultdirectory), 0, 1, 0, 1},
  {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
  {&__pyx_n_s_reversed_enumerate, __pyx_k_reversed_enumerate, sizeof(__pyx_k_reversed_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_rfind, __pyx_k_rfind, sizeof(__pyx_k_rfind), 0, 0, 1, 1},
  {&__pyx_n_s_rmtree, __pyx_k_rmtree, sizeof(__pyx_k_rmtree), 0, 0, 1, 1},
  {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
  {&__pyx_n_s_rrange, __pyx_k_rrange, sizeof(__pyx_k_rrange), 0, 0, 1, 1},
  {&__pyx_n_s_run_script, __pyx_k_run_script, sizeof(__pyx_k_run_script), 0, 0, 1, 1},
  {&__pyx_n_s_save_argv, __pyx_k_save_argv, sizeof(__pyx_k_save_argv), 0, 0, 1, 1},
  {&__pyx_n_s_script_args, __pyx_k_script_args, sizeof(__pyx_k_script_args), 0, 0, 1, 1},
  {&__pyx_n_s_script_name, __pyx_k_script_name, sizeof(__pyx_k_script_name), 0, 0, 1, 1},
  {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1},
  {&__pyx_n_s_section, __pyx_k_section, sizeof(__pyx_k_section), 0, 0, 1, 1},
  {&__pyx_n_s_sections, __pyx_k_sections, sizeof(__pyx_k_sections), 0, 0, 1, 1},
  {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
  {&__pyx_n_u_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 0, 1},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_n_s_selectedData, __pyx_k_selectedData, sizeof(__pyx_k_selectedData), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1},
  {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1},
  {&__pyx_n_u_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 1, 0, 1},
  {&__pyx_n_s_setTrainingActionParams, __pyx_k_setTrainingActionParams, sizeof(__pyx_k_setTrainingActionParams), 0, 0, 1, 1},
  {&__pyx_kp_u_set__s, __pyx_k_set__s, sizeof(__pyx_k_set__s), 0, 1, 0, 0},
  {&__pyx_n_s_setlen2, __pyx_k_setlen2, sizeof(__pyx_k_setlen2), 0, 0, 1, 1},
  {&__pyx_n_s_shft, __pyx_k_shft, sizeof(__pyx_k_shft), 0, 0, 1, 1},
  {&__pyx_n_s_shiftText, __pyx_k_shiftText, sizeof(__pyx_k_shiftText), 0, 0, 1, 1},
  {&__pyx_n_s_shutil, __pyx_k_shutil, sizeof(__pyx_k_shutil), 0, 0, 1, 1},
  {&__pyx_n_s_singleton, __pyx_k_singleton, sizeof(__pyx_k_singleton), 0, 0, 1, 1},
  {&__pyx_n_s_singleton2, __pyx_k_singleton2, sizeof(__pyx_k_singleton2), 0, 0, 1, 1},
  {&__pyx_n_s_singleton2_locals_lambda, __pyx_k_singleton2_locals_lambda, sizeof(__pyx_k_singleton2_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_singleton_locals_singleton_new, __pyx_k_singleton_locals_singleton_new, sizeof(__pyx_k_singleton_locals_singleton_new), 0, 0, 1, 1},
  {&__pyx_n_s_singleton_new, __pyx_k_singleton_new, sizeof(__pyx_k_singleton_new), 0, 0, 1, 1},
  {&__pyx_n_s_site, __pyx_k_site, sizeof(__pyx_k_site), 0, 0, 1, 1},
  {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
  {&__pyx_n_s_slicexrange, __pyx_k_slicexrange, sizeof(__pyx_k_slicexrange), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1},
  {&__pyx_n_s_splitfield, __pyx_k_splitfield, sizeof(__pyx_k_splitfield), 0, 0, 1, 1},
  {&__pyx_n_s_splitlines, __pyx_k_splitlines, sizeof(__pyx_k_splitlines), 0, 0, 1, 1},
  {&__pyx_n_s_sst, __pyx_k_sst, sizeof(__pyx_k_sst), 0, 0, 1, 1},
  {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1},
  {&__pyx_n_s_st2, __pyx_k_st2, sizeof(__pyx_k_st2), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stlen, __pyx_k_stlen, sizeof(__pyx_k_stlen), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_strCommon, __pyx_k_strCommon, sizeof(__pyx_k_strCommon), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {&__pyx_n_s_strtolen, __pyx_k_strtolen, sizeof(__pyx_k_strtolen), 0, 0, 1, 1},
  {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1},
  {&__pyx_n_s_suffix, __pyx_k_suffix, sizeof(__pyx_k_suffix), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_kp_u_t_2, __pyx_k_t_2, sizeof(__pyx_k_t_2), 0, 1, 0, 0},
  {&__pyx_n_s_targ, __pyx_k_targ, sizeof(__pyx_k_targ), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
  {&__pyx_n_s_tempDir, __pyx_k_tempDir, sizeof(__pyx_k_tempDir), 0, 0, 1, 1},
  {&__pyx_n_s_tempFileName, __pyx_k_tempFileName, sizeof(__pyx_k_tempFileName), 0, 0, 1, 1},
  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_s_testresidualstr, __pyx_k_testresidualstr, sizeof(__pyx_k_testresidualstr), 0, 0, 1, 1},
  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  {&__pyx_n_s_textAttr, __pyx_k_textAttr, sizeof(__pyx_k_textAttr), 0, 0, 1, 1},
  {&__pyx_n_s_textwriter, __pyx_k_textwriter, sizeof(__pyx_k_textwriter), 0, 0, 1, 1},
  {&__pyx_n_s_textwriter___init, __pyx_k_textwriter___init, sizeof(__pyx_k_textwriter___init), 0, 0, 1, 1},
  {&__pyx_n_s_textwriter_flush, __pyx_k_textwriter_flush, sizeof(__pyx_k_textwriter_flush), 0, 0, 1, 1},
  {&__pyx_n_s_textwriter_write, __pyx_k_textwriter_write, sizeof(__pyx_k_textwriter_write), 0, 0, 1, 1},
  {&__pyx_n_s_textwriter_writeImage, __pyx_k_textwriter_writeImage, sizeof(__pyx_k_textwriter_writeImage), 0, 0, 1, 1},
  {&__pyx_n_s_tg, __pyx_k_tg, sizeof(__pyx_k_tg), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tilde, __pyx_k_tilde, sizeof(__pyx_k_tilde), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_timestr, __pyx_k_timestr, sizeof(__pyx_k_timestr), 0, 0, 1, 1},
  {&__pyx_n_s_titles, __pyx_k_titles, sizeof(__pyx_k_titles), 0, 0, 1, 1},
  {&__pyx_n_u_training, __pyx_k_training, sizeof(__pyx_k_training), 0, 1, 0, 1},
  {&__pyx_n_u_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 1, 0, 1},
  {&__pyx_n_s_tt, __pyx_k_tt, sizeof(__pyx_k_tt), 0, 0, 1, 1},
  {&__pyx_n_s_unquote, __pyx_k_unquote, sizeof(__pyx_k_unquote), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_updatesection, __pyx_k_updatesection, sizeof(__pyx_k_updatesection), 0, 0, 1, 1},
  {&__pyx_kp_u_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 1, 0, 0},
  {&__pyx_kp_u_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 1, 0, 0},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_vallist, __pyx_k_vallist, sizeof(__pyx_k_vallist), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_walk, __pyx_k_walk, sizeof(__pyx_k_walk), 0, 0, 1, 1},
  {&__pyx_n_s_worksheetstr, __pyx_k_worksheetstr, sizeof(__pyx_k_worksheetstr), 0, 0, 1, 1},
  {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_writeImage, __pyx_k_writeImage, sizeof(__pyx_k_writeImage), 0, 0, 1, 1},
  {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1},
  {&__pyx_n_s_ww, __pyx_k_ww, sizeof(__pyx_k_ww), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 50, __pyx_L1_error)
  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 108, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 367, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 893, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 898, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 199, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 377, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 420, __pyx_L1_error)
  __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) __PYX_ERR(0, 425, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 506, __pyx_L1_error)
  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 511, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 569, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 611, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 697, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 703, __pyx_L1_error)
  __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 743, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 769, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 1296, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 1341, __pyx_L1_error)
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 1377, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "metaphor/monal/util/toolbox.py":56
 * 
 * def homedir():
 *     return os.path.expanduser(chr(126))             # <<<<<<<<<<<<<<
 * 
 * global_cache = {}
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_126); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "metaphor/monal/util/toolbox.py":91
 * def cmp_to_key(mycmp):
 *     'Convert a cmp= function into a key= function'
 *     class K(object):             # <<<<<<<<<<<<<<
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "metaphor/monal/util/toolbox.py":92
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 *         def __init__(self, obj, *args):             # <<<<<<<<<<<<<<
 *             self.obj = obj
 *         def __lt__(self, other):
 */
  __pyx_tuple__3 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_obj, __pyx_n_s_args); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);
  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_init, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 92, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":94
 *         def __init__(self, obj, *args):
 *             self.obj = obj
 *         def __lt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_lt, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 94, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":96
 *         def __lt__(self, other):
 *             return mycmp(self.obj, other.obj) < 0
 *         def __gt__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_gt, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 96, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":98
 *         def __gt__(self, other):
 *             return mycmp(self.obj, other.obj) > 0
 *         def __eq__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):
 */
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_eq, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 98, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":100
 *         def __eq__(self, other):
 *             return mycmp(self.obj, other.obj) == 0
 *         def __le__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_le, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 100, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":102
 *         def __le__(self, other):
 *             return mycmp(self.obj, other.obj) <= 0
 *         def __ge__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):
 */
  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_ge, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 102, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":104
 *         def __ge__(self, other):
 *             return mycmp(self.obj, other.obj) >= 0
 *         def __ne__(self, other):             # <<<<<<<<<<<<<<
 *             return mycmp(self.obj, other.obj) != 0
 *     return K
 */
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_ne, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 104, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":299
 *     configfile = ""
 *     for val in sys.argv:
 *         if val.startswith("-c"):             # <<<<<<<<<<<<<<
 *             configfile = unquote(val[2:])
 *     if not configfile:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_c); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "metaphor/monal/util/toolbox.py":300
 *     for val in sys.argv:
 *         if val.startswith("-c"):
 *             configfile = unquote(val[2:])             # <<<<<<<<<<<<<<
 *     if not configfile:
 *         configfile = lookForFile(candidate, None, modname)
 */
  __pyx_slice__19 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__19);
  __Pyx_GIVEREF(__pyx_slice__19);

  /* "metaphor/monal/util/toolbox.py":412
 * 
 * def run_script(script_name, script_args=None):
 *     save_argv = sys.argv[:]             # <<<<<<<<<<<<<<
 *     g = {'__file__': script_name}
 *     l = {}
 */
  __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__21);
  __Pyx_GIVEREF(__pyx_slice__21);

  /* "metaphor/monal/util/toolbox.py":419
 *             sys.argv[0] = script_name
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args             # <<<<<<<<<<<<<<
 *             with open(script_name) as f:
 *                 exec(f.read(), g, l)
 */
  __pyx_slice__22 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__22);
  __Pyx_GIVEREF(__pyx_slice__22);

  /* "metaphor/monal/util/toolbox.py":420
 *             if script_args is not None:
 *                 sys.argv[1:] = script_args
 *             with open(script_name) as f:             # <<<<<<<<<<<<<<
 *                 exec(f.read(), g, l)
 *         finally:
 */
  __pyx_tuple__23 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "metaphor/monal/util/toolbox.py":433
 * 
 * def dupescape(source):
 *     lst = source.split('\\')             # <<<<<<<<<<<<<<
 *     return '\\\\'.join(lst)
 * 
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u__24); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "metaphor/monal/util/toolbox.py":449
 *     lst2 = []
 *     if os.path.exists(filename):
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 */
  __pyx_tuple__27 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "metaphor/monal/util/toolbox.py":452
 *             lst = f.readlines()
 *         lst2 = [val for val in lst if val.find(test) < 0]
 *         with open(filename, "w") as f:             # <<<<<<<<<<<<<<
 *             st = "".join(lst2)
 *             f.write(st)
 */
  __pyx_tuple__28 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "metaphor/monal/util/toolbox.py":461
 *         OK = True
 *         lst = []
 *         with open(filename, "r") as f:             # <<<<<<<<<<<<<<
 *             lst = f.readlines()
 *         for st in lst:
 */
  __pyx_tuple__29 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "metaphor/monal/util/toolbox.py":470
 *         with open(filename, "a") as f:
 *             f.write(line)
 *             f.write("\n")             # <<<<<<<<<<<<<<
 * 
 * def analyserange(rangestr):
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u__20); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "metaphor/monal/util/toolbox.py":468
 *                 break
 *     if OK:
 *         with open(filename, "a") as f:             # <<<<<<<<<<<<<<
 *             f.write(line)
 *             f.write("\n")
 */
  __pyx_tuple__31 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "metaphor/monal/util/toolbox.py":474
 * def analyserange(rangestr):
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")             # <<<<<<<<<<<<<<
 *     ll = len(lst)
 *     if ll == 2:
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u__32); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "metaphor/monal/util/toolbox.py":486
 *     st = os.path.splitext(path)[1]
 *     if st:
 *         return st[1:]             # <<<<<<<<<<<<<<
 *     return st
 * 
 */
  __pyx_slice__34 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__34);
  __Pyx_GIVEREF(__pyx_slice__34);

  /* "metaphor/monal/util/toolbox.py":563
 * def getPythonPath():
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")             # <<<<<<<<<<<<<<
 *     except:
 *         #import sys
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u__35); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "metaphor/monal/util/toolbox.py":578
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 *     cur = cur.split(";")             # <<<<<<<<<<<<<<
 *     if before and isinstance(path, str):
 *         cur = [path] + cur
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u__35); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "metaphor/monal/util/toolbox.py":656
 *         item = res[0]
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])             # <<<<<<<<<<<<<<
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 */
  __pyx_slice__38 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__38);
  __Pyx_GIVEREF(__pyx_slice__38);

  /* "metaphor/monal/util/toolbox.py":672
 *         item = res[0]
 *         source = source[:-len(item)]
 *         lst.append(item[1:-1])             # <<<<<<<<<<<<<<
 *         res = re.findall(test, source)
 *     test = r"\A[A-Za-z_]{1}[-\w]*\Z"
 */
  __pyx_slice__39 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__39);
  __Pyx_GIVEREF(__pyx_slice__39);

  /* "metaphor/monal/util/toolbox.py":683
 *             else: return source, lst[0]
 *         else: return source, None
 *     return None, None             # <<<<<<<<<<<<<<
 * 
 * def rrange(start, stop=None, step=None):
 */
  __pyx_tuple__40 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "metaphor/monal/util/toolbox.py":723
 *     if not direct:
 *         for i, arg in enumerate(sys.argv):
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):             # <<<<<<<<<<<<<<
 *                 try:
 *                     temp = int(arg[2:])
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_l); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_L); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "metaphor/monal/util/toolbox.py":725
 *             if i and (arg.startswith("/l") or arg.startswith("/L")):
 *                 try:
 *                     temp = int(arg[2:])             # <<<<<<<<<<<<<<
 *                     if temp < levelmax:
 *                         alevel = int(arg[2:])
 */
  __pyx_slice__44 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__44)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__44);
  __Pyx_GIVEREF(__pyx_slice__44);

  /* "metaphor/monal/util/toolbox.py":727
 *                     temp = int(arg[2:])
 *                     if temp < levelmax:
 *                         alevel = int(arg[2:])             # <<<<<<<<<<<<<<
 *                 except: pass
 *                 break
 */
  __pyx_slice__45 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__45);
  __Pyx_GIVEREF(__pyx_slice__45);

  /* "metaphor/monal/util/toolbox.py":739
 * def namefromfilename(filename):
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u__46); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_slice__48 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__48);
  __Pyx_GIVEREF(__pyx_slice__48);

  /* "metaphor/monal/util/toolbox.py":743
 * 
 * def inttohexstr(value, lmin=2):
 *     res = hex(value)[2:]             # <<<<<<<<<<<<<<
 *     res = "0"*(lmin - len(res)) + res
 *     return res
 */
  __pyx_slice__49 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__49);
  __Pyx_GIVEREF(__pyx_slice__49);

  /* "metaphor/monal/util/toolbox.py":753
 *     res = ""
 *     while len(res) < ll:
 *         n = random.randint(ord('A'), ord('Z'))             # <<<<<<<<<<<<<<
 *         res += chr(n)
 *     return res
 */
  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_int_65, __pyx_int_90); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "metaphor/monal/util/toolbox.py":774
 *     #print("CALLABLE:", end=' ')
 *     if isinstance(item, collections.Callable):
 *         print("CALLABLE: Yes")             # <<<<<<<<<<<<<<
 *     else:
 *         print("CALLABLE: no")
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_CALLABLE_Yes); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "metaphor/monal/util/toolbox.py":776
 *         print("CALLABLE: Yes")
 *     else:
 *         print("CALLABLE: no")             # <<<<<<<<<<<<<<
 *     if hasattr(item, '__doc__'):
 *         doc = getattr(item, '__doc__')
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_CALLABLE_no); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "metaphor/monal/util/toolbox.py":780
 *         doc = getattr(item, '__doc__')
 *     doc = doc.strip()   # Remove leading/trailing whitespace.
 *     firstline = doc.split('\n')[0]             # <<<<<<<<<<<<<<
 *     print(("DOC:     ", firstline))
 * 
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u__20); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "metaphor/monal/util/toolbox.py":808
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):
 *     def setlen2(st):             # <<<<<<<<<<<<<<
 *         if len(st) >= 2:
 *             return st
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_st); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_setlen2, 808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 808, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":814
 * 
 *     mem = datestr.split()
 *     datelst = mem[0].split('/')             # <<<<<<<<<<<<<<
 *     day = setlen2(datelst[0])
 *     month = setlen2(datelst[1])
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u__56); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "metaphor/monal/util/toolbox.py":823
 *         date0 += 1900
 *     st = '/'.join([day, month, str(date0)])
 *     return ' '.join([st] + mem[1:])             # <<<<<<<<<<<<<<
 * 
 * def strCommon(A, B, caseSensitive = True):
 */
  __pyx_slice__59 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__59);
  __Pyx_GIVEREF(__pyx_slice__59);

  /* "metaphor/monal/util/toolbox.py":1008
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 *     def wrapper(*args):             # <<<<<<<<<<<<<<
 *         t = threading.Thread(target=func, args=args)
 *         t.start()
 */
  __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_t); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_wrapper, 1008, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1192
 * 
 * def regFile(source, ext):
 *     n = source.rfind('.')             # <<<<<<<<<<<<<<
 *     if (n > 0): return source[:n] + '_R' + ext
 *     return source + '_R' + ext
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u__46); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "metaphor/monal/util/toolbox.py":1303
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):
 *     def modifiedstr(value, sep, lim):             # <<<<<<<<<<<<<<
 *         st = str(value).ljust(sep, fillchar)
 *         if lim: return st[:sep]
 */
  __pyx_tuple__64 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_sep, __pyx_n_s_lim, __pyx_n_s_st); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_modifiedstr, 1303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1303, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1426
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):
 *         it =  cls.__dict__.get('__it__')             # <<<<<<<<<<<<<<
 *         if it is not None:
 *             return it
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_u_it); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "metaphor/monal/util/toolbox.py":1425
 * 
 *     @functools.wraps(cls.__new__)
 *     def singleton_new(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         it =  cls.__dict__.get('__it__')
 *         if it is not None:
 */
  __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_it_2); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_singleton_new, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1425, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1450
 *         props = {}
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_u_get_2); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "metaphor/monal/util/toolbox.py":1451
 *         for name in list(cls.__dict__.keys()):
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_u_set); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "metaphor/monal/util/toolbox.py":1452
 *             if (name.startswith("_get_") or
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or             # <<<<<<<<<<<<<<
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_u_del); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "metaphor/monal/util/toolbox.py":1453
 *                 name.startswith("_set_") or
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):             # <<<<<<<<<<<<<<
 *                 props[name[5:]] = 1
 *         for name in (name for name, val in list(props.items()) if val==1):
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_u_doc_2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "metaphor/monal/util/toolbox.py":1454
 *                 name.startswith("_del_") or
 *                 name.startswith("_doc_")):
 *                 props[name[5:]] = 1             # <<<<<<<<<<<<<<
 *         for name in (name for name, val in list(props.items()) if val==1):
 *             fget = getattr(cls, "_get_%s" % name, None)
 */
  __pyx_slice__78 = PySlice_New(__pyx_int_5, Py_None, Py_None); if (unlikely(!__pyx_slice__78)) __PYX_ERR(0, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__78);
  __Pyx_GIVEREF(__pyx_slice__78);

  /* "metaphor/monal/util/toolbox.py":55
 *  #import collections
 * 
 * def homedir():             # <<<<<<<<<<<<<<
 *     return os.path.expanduser(chr(126))
 * 
 */
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_homedir, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 55, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":59
 * 
 * global_cache = {}
 * def cached_listdir(path):             # <<<<<<<<<<<<<<
 *     """Substitute of dircache.listdir for python 3.X
 *     """
 */
  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_res); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_cached_listdir, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 59, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */
  __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_mycmp, __pyx_n_s_K); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_cmp_to_key, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 89, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":108
 *     return K
 * 
 * tilde = chr(0x007E)             # <<<<<<<<<<<<<<
 * escape_dict={'\a':r'\a',
 *            '\b':r'\b',
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_int_126); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "metaphor/monal/util/toolbox.py":142
 * #     return st
 * #
 * def setTrainingActionParams(config, propertyname, initCount=1, initstddev=0.3,             # <<<<<<<<<<<<<<
 *         epochs=0, resultdir="", seed=0, criterion=C.TCR_NOSORT, **kwd):
 *     """Introducing the training parameters in the configuration object.
 */
  __pyx_tuple__101 = PyTuple_Pack(11, __pyx_n_s_config, __pyx_n_s_propertyname, __pyx_n_s_initCount, __pyx_n_s_initstddev, __pyx_n_s_epochs, __pyx_n_s_resultdir, __pyx_n_s_seed, __pyx_n_s_criterion, __pyx_n_s_kwd, __pyx_n_s_st, __pyx_n_s_dic); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(8, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_setTrainingActionParams, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 142, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":185
 *     return config
 * 
 * def raw(text):             # <<<<<<<<<<<<<<
 *     """Returns a raw string representation of text"""
 *     return "".join([escape_dict.get(char, char) for char in text])
 */
  __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_char); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_raw, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 185, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":192
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 *     def __init__(self, *args, **argv):             # <<<<<<<<<<<<<<
 *         super(idemDefaultDict, self).__init__()
 *         self.update(*args, **argv)
 */
  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_argv); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_init, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 192, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":196
 *         self.update(*args, **argv)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)
 */
  __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getitem, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 196, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":212
 * #     return val
 * 
 * def lookInTree(filename, base):             # <<<<<<<<<<<<<<
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 */
  __pyx_tuple__109 = PyTuple_Pack(5, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_root, __pyx_n_s__70, __pyx_n_s_filelist); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_lookInTree, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 212, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":223
 * #                 return st
 * 
 * def lookForFile(filename, package, module="", optional="", abspath=False, locationpath=""):             # <<<<<<<<<<<<<<
 *     """Recherche un fichier dans un package, et dans les enfants de ses ancetres
 *     portant le meme nom
 */
  __pyx_tuple__111 = PyTuple_Pack(17, __pyx_n_s_filename, __pyx_n_s_package, __pyx_n_s_module_2, __pyx_n_s_optional, __pyx_n_s_abspath, __pyx_n_s_locationpath, __pyx_n_s_filename2, __pyx_n_s_test, __pyx_n_s_pathlist, __pyx_n_s_val, __pyx_n_s_base, __pyx_n_s_root, __pyx_n_s_dirs, __pyx_n_s__70, __pyx_n_s_mydir, __pyx_n_s_mytest, __pyx_n_s_path); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(6, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_lookForFile, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 223, __pyx_L1_error)
  __pyx_tuple__113 = PyTuple_Pack(4, ((PyObject*)__pyx_kp_u__17), ((PyObject*)__pyx_kp_u__17), ((PyObject *)Py_False), ((PyObject*)__pyx_kp_u__17)); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "metaphor/monal/util/toolbox.py":283
 *         return test
 * 
 * def addpathlist(source, packagename, lst):             # <<<<<<<<<<<<<<
 *     if source:
 *         dirr, base = os.path.split(source)
 */
  __pyx_tuple__114 = PyTuple_Pack(8, __pyx_n_s_source, __pyx_n_s_packagename, __pyx_n_s_lst, __pyx_n_s_dirr, __pyx_n_s_base, __pyx_n_s_root, __pyx_n_s_dirs, __pyx_n_s__70); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_addpathlist, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 283, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":296
 *     return lst
 * 
 * def getconfigfile(filesource, candidate, modname=""):             # <<<<<<<<<<<<<<
 *     configfile = ""
 *     for val in sys.argv:
 */
  __pyx_tuple__116 = PyTuple_Pack(5, __pyx_n_s_filesource, __pyx_n_s_candidate, __pyx_n_s_modname, __pyx_n_s_configfile, __pyx_n_s_val); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getconfigfile, 296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 296, __pyx_L1_error)
  __pyx_tuple__118 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_u__17)); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "metaphor/monal/util/toolbox.py":307
 *     return configfile
 * 
 * def getOptions(configfile, section):             # <<<<<<<<<<<<<<
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 */
  __pyx_tuple__119 = PyTuple_Pack(6, __pyx_n_s_configfile, __pyx_n_s_section, __pyx_n_s_defconf, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getOptions, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 307, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":331
 * #     return retcode
 * 
 * def getexecparam(*args, **kwarg):             # <<<<<<<<<<<<<<
 *     """lance un executable, et retourne les premires lignes de la rponse
 *     """
 */
  __pyx_tuple__121 = PyTuple_Pack(7, __pyx_n_s_args, __pyx_n_s_kwarg, __pyx_n_s_subprocess, __pyx_n_s_sst, __pyx_n_s_l_2, __pyx_n_s_st, __pyx_n_s_st2); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getexecparam, 331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 331, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":367
 * # timefmtlist = ["%H:%M:%S", "%H:%M", "%H", "%Hh%Mm%S", "%Hh%M"]
 * 
 * class textwriter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, target):
 *         super(textwriter, self).__init__()
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "metaphor/monal/util/toolbox.py":368
 * 
 * class textwriter(object):
 *     def __init__(self, target):             # <<<<<<<<<<<<<<
 *         super(textwriter, self).__init__()
 *         self.target = target
 */
  __pyx_tuple__124 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_target); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_init, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 368, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":372
 *         self.target = target
 * 
 *     def writeImage(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 */
  __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwds, __pyx_n_s_err); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_writeImage, 372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 372, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":379
 *             print (err)
 * 
 *     def write(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         test = "color" in kwds
 *         if test:
 */
  __pyx_tuple__128 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwds, __pyx_n_s_test, __pyx_n_s_color, __pyx_n_s_textAttr, __pyx_n_s_colmem, __pyx_n_s_res); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_write, 379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 379, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":408
 *         return res
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_flush, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 408, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":411
 *         pass
 * 
 * def run_script(script_name, script_args=None):             # <<<<<<<<<<<<<<
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}
 */
  __pyx_tuple__132 = PyTuple_Pack(6, __pyx_n_s_script_name, __pyx_n_s_script_args, __pyx_n_s_save_argv, __pyx_n_s_g, __pyx_n_s_l_2, __pyx_n_s_f_2); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_run_script, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 411, __pyx_L1_error)
  __pyx_tuple__134 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "metaphor/monal/util/toolbox.py":432
 *         raise
 * 
 * def dupescape(source):             # <<<<<<<<<<<<<<
 *     lst = source.split('\\')
 *     return '\\\\'.join(lst)
 */
  __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_source, __pyx_n_s_lst); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_dupescape, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 432, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":436
 *     return '\\\\'.join(lst)
 * 
 * def add2path(directory):             # <<<<<<<<<<<<<<
 *     #import sys
 *     directory = os.path.normpath(directory)
 */
  __pyx_tuple__137 = PyTuple_Pack(4, __pyx_n_s_directory, __pyx_n_s_dirr, __pyx_n_s_lst, __pyx_n_s_dirloc); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_add2path, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 436, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":446
 *     lst.insert(1, directory)
 * 
 * def removelinewith(filename, test):             # <<<<<<<<<<<<<<
 *     lst2 = []
 *     if os.path.exists(filename):
 */
  __pyx_tuple__139 = PyTuple_Pack(7, __pyx_n_s_filename, __pyx_n_s_test, __pyx_n_s_lst2, __pyx_n_s_f_2, __pyx_n_s_lst, __pyx_n_s_st, __pyx_n_s_val); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_removelinewith, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 446, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":456
 *             f.write(st)
 * 
 * def adduniqueline(line, filename):             # <<<<<<<<<<<<<<
 *     OK = not os.path.exists(filename)
 *     if not OK:
 */
  __pyx_tuple__141 = PyTuple_Pack(6, __pyx_n_s_line, __pyx_n_s_filename, __pyx_n_s_OK, __pyx_n_s_lst, __pyx_n_s_f_2, __pyx_n_s_st); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_adduniqueline, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 456, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":472
 *             f.write("\n")
 * 
 * def analyserange(rangestr):             # <<<<<<<<<<<<<<
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")
 */
  __pyx_tuple__143 = PyTuple_Pack(4, __pyx_n_s_rangestr, __pyx_n_s_lst, __pyx_n_s_ll, __pyx_n_s_worksheetstr); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_analyserange, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 472, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":483
 *     return rangestr, worksheetstr
 * 
 * def getfiletype(path):             # <<<<<<<<<<<<<<
 *     st = os.path.splitext(path)[1]
 *     if st:
 */
  __pyx_tuple__145 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_st); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getfiletype, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 483, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":489
 *     return st
 * 
 * def make_dir(dir_path, doprint=False, writer=sys.stdout, forbidden=[]):             # <<<<<<<<<<<<<<
 *     """Wrapper for os.mkdir, that will not fail if directory
 *     already exists.
 */
  __pyx_tuple__147 = PyTuple_Pack(5, __pyx_n_s_dir_path, __pyx_n_s_doprint, __pyx_n_s_writer, __pyx_n_s_forbidden, __pyx_n_s_err); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_make_dir, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 489, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":548
 * #         writer.write("cleaning %s\n"% dname)
 * 
 * def tempDir(name=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     if name:
 */
  __pyx_tuple__149 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_mydir); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_tempDir, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 548, __pyx_L1_error)
  __pyx_tuple__151 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_u__17)); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "metaphor/monal/util/toolbox.py":554
 *     return mydir
 * 
 * def tempFileName(length=3, prefix="", suffix=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 */
  __pyx_tuple__152 = PyTuple_Pack(5, __pyx_n_s_length, __pyx_n_s_prefix, __pyx_n_s_suffix, __pyx_n_s_mydir, __pyx_n_s_st); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_tempFileName, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 554, __pyx_L1_error)
  __pyx_tuple__154 = PyTuple_Pack(3, ((PyObject *)__pyx_int_3), ((PyObject*)__pyx_kp_u__17), ((PyObject*)__pyx_kp_u__17)); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "metaphor/monal/util/toolbox.py":561
 *     return st
 * 
 * def getPythonPath():             # <<<<<<<<<<<<<<
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")
 */
  __pyx_tuple__155 = PyTuple_Pack(5, __pyx_n_s_lst, __pyx_n_s_l_2, __pyx_n_s_n_2, __pyx_n_s_i, __pyx_n_s_val); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getPythonPath, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 561, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":575
 *         return lst[n]
 * 
 * def addPythonPath(path, before=True):             # <<<<<<<<<<<<<<
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 */
  __pyx_tuple__157 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_before, __pyx_n_s_cur); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_addPythonPath, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 575, __pyx_L1_error)
  __pyx_tuple__159 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "metaphor/monal/util/toolbox.py":610
 * #     return ";".join(dataToStrList(source, dateindex, decimal)) + "\n"
 * 
 * def slicexrange(aslice):             # <<<<<<<<<<<<<<
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_n_s_aslice); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_slicexrange, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 610, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":642
 * #     return max(date1, date2)
 * 
 * def alllist(source, sep=";"):             # <<<<<<<<<<<<<<
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]
 */
  __pyx_tuple__162 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_sep, __pyx_n_s_val); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_alllist, 642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 642, __pyx_L1_error)
  __pyx_tuple__164 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_u__35)); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "metaphor/monal/util/toolbox.py":648
 *     except: return source
 * 
 * def isfield(source):             # <<<<<<<<<<<<<<
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"
 */
  __pyx_tuple__165 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_test, __pyx_n_s_lst, __pyx_n_s_res, __pyx_n_s_item); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_isfield, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 648, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":663
 *     except: return False
 * 
 * def splitfield(source):             # <<<<<<<<<<<<<<
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()
 */
  __pyx_tuple__167 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_test, __pyx_n_s_lst, __pyx_n_s_res, __pyx_n_s_item); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_splitfield, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 663, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":685
 *     return None, None
 * 
 * def rrange(start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *     if not step:
 *         step = 1.0
 */
  __pyx_tuple__169 = PyTuple_Pack(4, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_cur); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_rrange, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 685, __pyx_L1_error)
  __pyx_tuple__170 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "metaphor/monal/util/toolbox.py":699
 *     raise StopIteration
 * 
 * def boolstr(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str):
 *         try:
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_boolstr, 699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 699, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":707
 * 
 * 
 * def isnum(key):             # <<<<<<<<<<<<<<
 *     return isinstance(key, int)
 * 
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_isnum, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 707, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":710
 *     return isinstance(key, int)
 * 
 * def appendex(lst, value):             # <<<<<<<<<<<<<<
 *     """extension de 'append' sans doublon"""
 *     try:
 */
  __pyx_tuple__175 = PyTuple_Pack(2, __pyx_n_s_lst, __pyx_n_s_value); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_appendex, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 710, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":718
 *         return lst.index(value)
 * 
 * def NDKdllName(levelmax=3, direct=False):             # <<<<<<<<<<<<<<
 *     #import sys
 *     alevel = levelmax
 */
  __pyx_tuple__177 = PyTuple_Pack(8, __pyx_n_s_levelmax, __pyx_n_s_direct, __pyx_n_s_alevel, __pyx_n_s_i, __pyx_n_s_arg, __pyx_n_s_temp, __pyx_n_s_res, __pyx_n_s_st); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_NDKdllName, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 718, __pyx_L1_error)
  __pyx_tuple__179 = PyTuple_Pack(2, ((PyObject *)__pyx_int_3), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "metaphor/monal/util/toolbox.py":737
 *     return res, alevel
 * 
 * def namefromfilename(filename):             # <<<<<<<<<<<<<<
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])
 */
  __pyx_tuple__180 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_result); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_namefromfilename, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 737, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":742
 *     return result
 * 
 * def inttohexstr(value, lmin=2):             # <<<<<<<<<<<<<<
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res
 */
  __pyx_tuple__182 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_lmin, __pyx_n_s_res); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_inttohexstr, 742, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 742, __pyx_L1_error)
  __pyx_tuple__184 = PyTuple_Pack(1, ((PyObject *)__pyx_int_2)); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "metaphor/monal/util/toolbox.py":747
 *     return res
 * 
 * def hexstrtoint(value):             # <<<<<<<<<<<<<<
 *     return int(value, 16)
 * 
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_hexstrtoint, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 747, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":750
 *     return int(value, 16)
 * 
 * def aleastr(ll):             # <<<<<<<<<<<<<<
 *     res = ""
 *     while len(res) < ll:
 */
  __pyx_tuple__187 = PyTuple_Pack(3, __pyx_n_s_ll, __pyx_n_s_res, __pyx_n_s_n_2); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_aleastr, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 750, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":757
 *     return res
 * 
 * def strtolen(value, length):             # <<<<<<<<<<<<<<
 *     res = str(value)[:length]
 *     if len(res) < length:
 */
  __pyx_tuple__189 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_length, __pyx_n_s_res); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_strtolen, 757, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 757, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":763
 *     return res
 * 
 * def interrogate(item):             # <<<<<<<<<<<<<<
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):
 */
  __pyx_tuple__191 = PyTuple_Pack(3, __pyx_n_s_item, __pyx_n_s_doc_3, __pyx_n_s_firstline); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_interrogate, 763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 763, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":807
 * #    else:
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):             # <<<<<<<<<<<<<<
 *     def setlen2(st):
 *         if len(st) >= 2:
 */
  __pyx_tuple__193 = PyTuple_Pack(9, __pyx_n_s_datestr, __pyx_n_s_setlen2, __pyx_n_s_setlen2, __pyx_n_s_mem, __pyx_n_s_datelst, __pyx_n_s_day, __pyx_n_s_month, __pyx_n_s_date0, __pyx_n_s_st); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_datelong, 807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 807, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":825
 *     return ' '.join([st] + mem[1:])
 * 
 * def strCommon(A, B, caseSensitive = True):             # <<<<<<<<<<<<<<
 *     if not caseSensitive:
 *         A = A.lower()
 */
  __pyx_tuple__195 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_caseSensitive, __pyx_n_s_n_2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_strCommon, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 825, __pyx_L1_error)
  __pyx_tuple__197 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "metaphor/monal/util/toolbox.py":880
 * #     return cmpstr(X, Y, getext)#lambda st: rpartition(st, '.')[2]
 * 
 * def getFilesByExt(directory, ext='', casesensitive=True):             # <<<<<<<<<<<<<<
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 */
  __pyx_tuple__198 = PyTuple_Pack(6, __pyx_n_s_directory, __pyx_n_s_ext, __pyx_n_s_casesensitive, __pyx_n_s_f_2, __pyx_n_s_df, __pyx_n_s_lf); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getFilesByExt, 880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 880, __pyx_L1_error)
  __pyx_tuple__199 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_u__17), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "metaphor/monal/util/toolbox.py":893
 *             yield df
 * 
 * class IndexValueError(IndexError):             # <<<<<<<<<<<<<<
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_builtin_IndexError); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "metaphor/monal/util/toolbox.py":895
 * class IndexValueError(IndexError):
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):             # <<<<<<<<<<<<<<
 *         IndexError.__init__(self, mess)
 *         self._index = index
 */
  __pyx_tuple__201 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_mess); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_init, 895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 895, __pyx_L1_error)
  __pyx_tuple__203 = PyTuple_Pack(2, ((PyObject *)__pyx_int_255), ((PyObject*)__pyx_kp_u__17)); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "metaphor/monal/util/toolbox.py":900
 *     index = property(lambda self: self._index)
 * 
 * def getIndexInVector(value, vector):             # <<<<<<<<<<<<<<
 *     """Recherche de l'indice d'un parametre du vecteur.
 * Lorsque le parametre est connu par son nom, on determine son indice en
 */
  __pyx_tuple__204 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_vector, __pyx_n_s_index, __pyx_n_s_ww); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getIndexInVector, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 900, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":912
 *     return -1
 * 
 * def getCVector(values, dim):             # <<<<<<<<<<<<<<
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):
 */
  __pyx_tuple__206 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_dim, __pyx_n_s_ll, __pyx_n_s_cValues, __pyx_n_s_i, __pyx_n_s_val); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getCVector, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 912, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":928
 *     except: return None
 * 
 * def product(iterator, init=1):             # <<<<<<<<<<<<<<
 *     res = init
 *     for val in iterator: res *= val
 */
  __pyx_tuple__208 = PyTuple_Pack(4, __pyx_n_s_iterator, __pyx_n_s_init_2, __pyx_n_s_res, __pyx_n_s_val); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_product, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 928, __pyx_L1_error)
  __pyx_tuple__210 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "metaphor/monal/util/toolbox.py":949
 * #def justify(source, ):
 * 
 * def getindexstr(target, index, Func):             # <<<<<<<<<<<<<<
 *     """Lecture dans une bibliotheque d'une valeur string indexee. La fonction
 * Func doit retourner la longueur de la chaine lorsqu'elle est appelee avec une
 */
  __pyx_tuple__211 = PyTuple_Pack(5, __pyx_n_s_target, __pyx_n_s_index, __pyx_n_s_Func, __pyx_n_s_dim, __pyx_n_s_targ); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_getindexstr, 949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 949, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":958
 *     return targ.value
 * 
 * def get2indexstr(index1, index2, Func):             # <<<<<<<<<<<<<<
 *     try:
 *         dim = Func(None, index1, index2)
 */
  __pyx_tuple__213 = PyTuple_Pack(5, __pyx_n_s_index1, __pyx_n_s_index2, __pyx_n_s_Func, __pyx_n_s_dim, __pyx_n_s_targ); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_get2indexstr, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 958, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":974
 * #            return os.path.join(res[0], filename)
 * 
 * def LoadConfig(myfile, config={}):             # <<<<<<<<<<<<<<
 *     """Returns a dictionary with key's of the form
 * <section>.<option> and the values."""
 */
  __pyx_tuple__215 = PyTuple_Pack(6, __pyx_n_s_myfile, __pyx_n_s_config, __pyx_n_s_cp, __pyx_n_s_sec, __pyx_n_s_name, __pyx_n_s_opt); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_LoadConfig, 974, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 974, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":989
 *     return config
 * 
 * def checkIndex(val, minincluded, maxexcluded):             # <<<<<<<<<<<<<<
 *     assert(minincluded <= val < maxexcluded)
 * 
 */
  __pyx_tuple__217 = PyTuple_Pack(3, __pyx_n_s_val, __pyx_n_s_minincluded, __pyx_n_s_maxexcluded); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_checkIndex, 989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 989, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":992
 *     assert(minincluded <= val < maxexcluded)
 * 
 * def listorstr(cible, sep=';'):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, str):
 *         return cible.split(sep)
 */
  __pyx_tuple__219 = PyTuple_Pack(2, __pyx_n_s_cible, __pyx_n_s_sep); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_listorstr, 992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 992, __pyx_L1_error)
  __pyx_tuple__221 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_u__35)); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "metaphor/monal/util/toolbox.py":997
 *     return str(cible)
 * 
 * def listorint(cible):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, int):
 *         return [cible]
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_cible); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_listorint, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 997, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1002
 *     return cible
 * 
 * def shiftText(text, shft):             # <<<<<<<<<<<<<<
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 */
  __pyx_tuple__224 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_shft, __pyx_n_s_st); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_shiftText, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1002, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */
  __pyx_tuple__226 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_threading, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_dothread, 1005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1005, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1013
 *     return wrapper
 * 
 * def fileexists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 */
  __pyx_tuple__228 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_val); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_fileexists, 1013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1013, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1020
 *     return True
 * 
 * def direxists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 */
  __pyx_tuple__230 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_val); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_direxists, 1020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1020, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1027
 *     return True
 * 
 * def checkFile(path, full=False):             # <<<<<<<<<<<<<<
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)
 */
  __pyx_tuple__232 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_full, __pyx_n_s_res); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_checkFile, 1027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __pyx_tuple__234 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);

  /* "metaphor/monal/util/toolbox.py":1033
 * CheckFile = checkFile
 * 
 * def fullFileName(value, chemin):             # <<<<<<<<<<<<<<
 *     if (chemin == '') or (value == ''):
 *         return value
 */
  __pyx_tuple__235 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_chemin, __pyx_n_s_res); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_fullFileName, 1033, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 1033, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1187
 * # DateTimeToStr = dateTimeToStr
 * 
 * def addToFileName(filename, addstr):             # <<<<<<<<<<<<<<
 *     name, ext = os.path.split(filename)
 *     return "%s%s%s" %(name, addstr, ext)
 */
  __pyx_tuple__237 = PyTuple_Pack(4, __pyx_n_s_filename, __pyx_n_s_addstr, __pyx_n_s_name, __pyx_n_s_ext); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_addToFileName, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 1187, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1191
 *     return "%s%s%s" %(name, addstr, ext)
 * 
 * def regFile(source, ext):             # <<<<<<<<<<<<<<
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext
 */
  __pyx_tuple__239 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_ext, __pyx_n_s_n_2); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_regFile, 1191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 1191, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1218
 * # NouvelleListe = nouvelleListe = NewList = newList
 * 
 * def ContainsAny(seq, aset):             # <<<<<<<<<<<<<<
 *     for c in seq:
 *         if c in aset:
 */
  __pyx_tuple__241 = PyTuple_Pack(3, __pyx_n_s_seq, __pyx_n_s_aset, __pyx_n_s_c_2); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_ContainsAny, 1218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 1218, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1224
 *     return False
 * 
 * def selectedData(data, select, default=None):             # <<<<<<<<<<<<<<
 *     if select: return data
 *     return default
 */
  __pyx_tuple__243 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_select, __pyx_n_s_default); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_selectedData, 1224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __pyx_tuple__245 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);

  /* "metaphor/monal/util/toolbox.py":1228
 *     return default
 * 
 * def hasBoolValue(llist, value):             # <<<<<<<<<<<<<<
 *     for tt in llist:
 *         if not tt ^ value: return True
 */
  __pyx_tuple__246 = PyTuple_Pack(3, __pyx_n_s_llist, __pyx_n_s_value, __pyx_n_s_tt); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_hasBoolValue, 1228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 1228, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1233
 *     return False
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):             # <<<<<<<<<<<<<<
 *     try:
 *         time.strptime(timestr, fmt)
 */
  __pyx_tuple__248 = PyTuple_Pack(2, __pyx_n_s_timestr, __pyx_n_s_fmt); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);
  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_IsValidHour, 1233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __pyx_tuple__250 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_u_H_M)); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);

  /* "metaphor/monal/util/toolbox.py":1291
 * #         return data
 * 
 * def isiterable(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str): return False
 *     try:
 */
  __pyx_tuple__251 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_isiterable, 1291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 1291, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1299
 *         return False
 * 
 * def stlen(value):             # <<<<<<<<<<<<<<
 *     return value, len(value)
 * 
 */
  __pyx_tuple__253 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_stlen, 1299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 1299, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */
  __pyx_tuple__255 = PyTuple_Pack(10, __pyx_n_s_sep, __pyx_n_s_iterator, __pyx_n_s_limited, __pyx_n_s_fillchar, __pyx_n_s_modifiedstr, __pyx_n_s_modifiedstr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_joinEx, 1302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __pyx_tuple__257 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject*)__pyx_kp_u__58)); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);

  /* "metaphor/monal/util/toolbox.py":1316
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):             # <<<<<<<<<<<<<<
 *     result = []
 *     for _ in range(nline):  #i
 */
  __pyx_tuple__258 = PyTuple_Pack(6, __pyx_n_s_nline, __pyx_n_s_nperline, __pyx_n_s_absmax, __pyx_n_s_result, __pyx_n_s__70, __pyx_n_s__70); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_createAleaTable, 1316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __pyx_tuple__260 = PyTuple_Pack(3, ((PyObject *)__pyx_int_1), ((PyObject *)__pyx_int_1), ((PyObject*)__pyx_float_1_0)); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);

  /* "metaphor/monal/util/toolbox.py":1322
 *     return result
 * 
 * def printnl(val, nl=1):             # <<<<<<<<<<<<<<
 *     print((val + "\n"*nl))
 * #    for i in xrange(nl):
 */
  __pyx_tuple__261 = PyTuple_Pack(2, __pyx_n_s_val, __pyx_n_s_nl); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_printnl, 1322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __pyx_tuple__263 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);

  /* "metaphor/monal/util/toolbox.py":1327
 * #        print
 * 
 * def printdoc(obj):             # <<<<<<<<<<<<<<
 *     lst= dir(obj)
 *     for value in lst:
 */
  __pyx_tuple__264 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_lst, __pyx_n_s_value, __pyx_n_s_st); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_printdoc, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1327, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */
  __pyx_tuple__266 = PyTuple_Pack(9, __pyx_n_s_dic, __pyx_n_s_intro, __pyx_n_s_inter, __pyx_n_s_dico2, __pyx_n_s_ll, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_PrettyPrintDic, 1336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __pyx_tuple__268 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_u__17), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);

  /* "metaphor/monal/util/toolbox.py":1352
 * #     return not any(val1 != val2 for val1, val2 in zip( lst1, lst2 ))
 * 
 * def FalseToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if not cond: return ''
 *     return value
 */
  __pyx_tuple__269 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_cond); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_FalseToEmpty, 1352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 1352, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1355
 *     if not cond: return ''
 *     return value
 * def TrueToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if cond: return ''
 *     return value
 */
  __pyx_tuple__271 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_cond); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_TrueToEmpty, 1355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 1355, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1359
 *     return value
 * 
 * def dataIterator(titles, *iterlist):             # <<<<<<<<<<<<<<
 *     yield list(titles)
 *     #ll = len(iterlist)
 */
  __pyx_tuple__273 = PyTuple_Pack(3, __pyx_n_s_titles, __pyx_n_s_iterlist, __pyx_n_s_vallist); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_dataIterator, 1359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1359, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1365
 *         yield(list(vallist))
 * 
 * def nonZeroToOne(val):             # <<<<<<<<<<<<<<
 *     if val != 0:
 *         return 1
 */
  __pyx_tuple__274 = PyTuple_Pack(1, __pyx_n_s_val); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_nonZeroToOne, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 1365, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1370
 *     return 0
 * 
 * def reversed_enumerate(iterable):             # <<<<<<<<<<<<<<
 *     try:
 *         n = len(iterable)
 */
  __pyx_tuple__276 = PyTuple_Pack(4, __pyx_n_s_iterable, __pyx_n_s_n_2, __pyx_n_s_seq, __pyx_n_s_val); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_reversed_enumerate, 1370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1370, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1381
 *         yield n, val
 * 
 * def _linkstr(a, b, c="", linker="_"):             # <<<<<<<<<<<<<<
 *     if c:
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 */
  __pyx_tuple__277 = PyTuple_Pack(4, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c_2, __pyx_n_s_linker); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_linkstr, 1381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_tuple__279 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_u__17), ((PyObject*)__pyx_n_u__70)); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);

  /* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */
  __pyx_tuple__280 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_instance); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_singleton2, 1414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 1414, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1419
 *     return instance
 * 
 * def singleton(cls):             # <<<<<<<<<<<<<<
 *     ''' Use class as singleton. '''
 * 
 */
  __pyx_tuple__282 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_singleton_new, __pyx_n_s_singleton_new); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_singleton, 1419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 1419, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */
  __pyx_tuple__284 = PyTuple_Pack(11, __pyx_n_s_cls, __pyx_n_s_name, __pyx_n_s_bases, __pyx_n_s_dico, __pyx_n_s_props, __pyx_n_s_fget, __pyx_n_s_fset, __pyx_n_s_fdel, __pyx_n_s_fdoc, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_init, 1446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 1446, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1506
 * #             pprint(*objects, **kwd)
 * 
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):             # <<<<<<<<<<<<<<
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 */
  __pyx_tuple__286 = PyTuple_Pack(10, __pyx_n_s_Fct, __pyx_n_s_root, __pyx_n_s_recursive, __pyx_n_s_dirs, __pyx_n_s_files, __pyx_n_s_filename, __pyx_n_s_cond, __pyx_n_s_tg, __pyx_n_s_dirname, __pyx_n_s_pth); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_deletefilebyFonction, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 1506, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */
  __pyx_tuple__288 = PyTuple_Pack(5, __pyx_n_s_paths_2, __pyx_n_s_py_version, __pyx_n_s_path, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_binaries_directory, 1521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 1521, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */
  __pyx_tuple__290 = PyTuple_Pack(3, __pyx_n_s_root, __pyx_n_s_ext, __pyx_n_s_Fct); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_monal_util_toolbox_py, __pyx_n_s_cleanfiles, 1541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_3 = PyFloat_FromDouble(0.3); if (unlikely(!__pyx_float_0_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1900 = PyInt_FromLong(1900); if (unlikely(!__pyx_int_1900)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_modinit_global_init_code(void); /*proto*/
static int __Pyx_modinit_variable_export_code(void); /*proto*/
static int __Pyx_modinit_function_export_code(void); /*proto*/
static int __Pyx_modinit_type_init_code(void); /*proto*/
static int __Pyx_modinit_type_import_code(void); /*proto*/
static int __Pyx_modinit_variable_import_code(void); /*proto*/
static int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct__cmp_to_key;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange) < 0) __PYX_ERR(0, 685, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_1_rrange;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt) < 0) __PYX_ERR(0, 880, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_2_getFilesByExt;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_3_dothread;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_4_joinEx;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_7_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic) < 0) __PYX_ERR(0, 1336, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_8_PrettyPrintDic;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 1341, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_9_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_10_dataIterator;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate) < 0) __PYX_ERR(0, 1370, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_11_reversed_enumerate;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2) < 0) __PYX_ERR(0, 1414, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2 = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_12_singleton2;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__) < 0) __PYX_ERR(0, 1446, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__ = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_13___init__;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1455, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_14_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory) < 0) __PYX_ERR(0, 1521, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_15_binaries_directory;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(0, 1527, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_16_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
  __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles.tp_dictoffset && __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles = &__pyx_type_8metaphor_5monal_4util_7toolbox___pyx_scope_struct_17_cleanfiles;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC inittoolbox(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC inittoolbox(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_toolbox(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_toolbox(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        result = PyDict_SetItemString(moddict, to_name, value);
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static int __pyx_pymod_exec_toolbox(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_toolbox(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("toolbox", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_metaphor__monal__util__toolbox) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "metaphor.monal.util.toolbox")) {
      if (unlikely(PyDict_SetItemString(modules, "metaphor.monal.util.toolbox", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "metaphor/monal/util/toolbox.py":30
 * 
 * 
 * import sys             # <<<<<<<<<<<<<<
 * from site import getusersitepackages
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":31
 * 
 * import sys
 * from site import getusersitepackages             # <<<<<<<<<<<<<<
 * 
 * from six import print_ as pprint
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_getusersitepackages);
  __Pyx_GIVEREF(__pyx_n_s_getusersitepackages);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getusersitepackages);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_site, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getusersitepackages); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getusersitepackages, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":33
 * from site import getusersitepackages
 * 
 * from six import print_ as pprint             # <<<<<<<<<<<<<<
 * 
 * from ctypes import c_char, c_double, byref
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_print_2);
  __Pyx_GIVEREF(__pyx_n_s_print_2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_print_2);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_print_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pprint, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":35
 * from six import print_ as pprint
 * 
 * from ctypes import c_char, c_double, byref             # <<<<<<<<<<<<<<
 * import time, datetime, os, string, re, random
 * import tempfile
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_c_char);
  __Pyx_GIVEREF(__pyx_n_s_c_char);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_c_char);
  __Pyx_INCREF(__pyx_n_s_c_double);
  __Pyx_GIVEREF(__pyx_n_s_c_double);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_c_double);
  __Pyx_INCREF(__pyx_n_s_byref);
  __Pyx_GIVEREF(__pyx_n_s_byref);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_byref);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_c_char); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_c_char, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_c_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_c_double, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_byref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_byref, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":36
 * 
 * from ctypes import c_char, c_double, byref
 * import time, datetime, os, string, re, random             # <<<<<<<<<<<<<<
 * import tempfile
 * from six import PY3
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_string, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_random, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":37
 * from ctypes import c_char, c_double, byref
 * import time, datetime, os, string, re, random
 * import tempfile             # <<<<<<<<<<<<<<
 * from six import PY3
 * from numpy import NaN
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_tempfile, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":38
 * import time, datetime, os, string, re, random
 * import tempfile
 * from six import PY3             # <<<<<<<<<<<<<<
 * from numpy import NaN
 * from shutil import rmtree
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_PY3);
  __Pyx_GIVEREF(__pyx_n_s_PY3);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PY3);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PY3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY3, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":39
 * import tempfile
 * from six import PY3
 * from numpy import NaN             # <<<<<<<<<<<<<<
 * from shutil import rmtree
 * import collections
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_NaN);
  __Pyx_GIVEREF(__pyx_n_s_NaN);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NaN);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaN, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":40
 * from six import PY3
 * from numpy import NaN
 * from shutil import rmtree             # <<<<<<<<<<<<<<
 * import collections
 * from ...nntoolbox.configparsertoolbox import defaultedConfigParser
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_rmtree);
  __Pyx_GIVEREF(__pyx_n_s_rmtree);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_rmtree);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_shutil, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_rmtree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rmtree, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":41
 * from numpy import NaN
 * from shutil import rmtree
 * import collections             # <<<<<<<<<<<<<<
 * from ...nntoolbox.configparsertoolbox import defaultedConfigParser
 * from ...nntoolbox.utils import unquote, blank, estimatedstr, testresidualstr, \
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":42
 * from shutil import rmtree
 * import collections
 * from ...nntoolbox.configparsertoolbox import defaultedConfigParser             # <<<<<<<<<<<<<<
 * from ...nntoolbox.utils import unquote, blank, estimatedstr, testresidualstr, \
 *     cleanDir
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_defaultedConfigParser);
  __Pyx_GIVEREF(__pyx_n_s_defaultedConfigParser);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_defaultedConfigParser);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_nntoolbox_configparsertoolbox, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_defaultedConfigParser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultedConfigParser, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":43
 * import collections
 * from ...nntoolbox.configparsertoolbox import defaultedConfigParser
 * from ...nntoolbox.utils import unquote, blank, estimatedstr, testresidualstr, \             # <<<<<<<<<<<<<<
 *     cleanDir
 * from .. import monalconst as C
 */
  __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_unquote);
  __Pyx_GIVEREF(__pyx_n_s_unquote);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unquote);
  __Pyx_INCREF(__pyx_n_s_blank);
  __Pyx_GIVEREF(__pyx_n_s_blank);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_blank);
  __Pyx_INCREF(__pyx_n_s_estimatedstr);
  __Pyx_GIVEREF(__pyx_n_s_estimatedstr);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_estimatedstr);
  __Pyx_INCREF(__pyx_n_s_testresidualstr);
  __Pyx_GIVEREF(__pyx_n_s_testresidualstr);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_testresidualstr);
  __Pyx_INCREF(__pyx_n_s_cleanDir);
  __Pyx_GIVEREF(__pyx_n_s_cleanDir);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_cleanDir);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_nntoolbox_utils, __pyx_t_2, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unquote); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_blank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blank, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_estimatedstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_estimatedstr, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_testresidualstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_testresidualstr, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cleanDir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanDir, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":45
 * from ...nntoolbox.utils import unquote, blank, estimatedstr, testresidualstr, \
 *     cleanDir
 * from .. import monalconst as C             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_monalconst);
  __Pyx_GIVEREF(__pyx_n_s_monalconst);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_monalconst);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s__17, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_monalconst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_C, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":47
 * from .. import monalconst as C
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from configparser import RawConfigParser, SafeConfigParser, ConfigParser, \
 *         NoSectionError, DEFAULTSECT
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "metaphor/monal/util/toolbox.py":48
 * 
 * try:
 *     from configparser import RawConfigParser, SafeConfigParser, ConfigParser, \             # <<<<<<<<<<<<<<
 *         NoSectionError, DEFAULTSECT
 * except ImportError:
 */
      __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_RawConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_RawConfigParser);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_RawConfigParser);
      __Pyx_INCREF(__pyx_n_s_SafeConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_SafeConfigParser);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SafeConfigParser);
      __Pyx_INCREF(__pyx_n_s_ConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_ConfigParser);
      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ConfigParser);
      __Pyx_INCREF(__pyx_n_s_NoSectionError);
      __Pyx_GIVEREF(__pyx_n_s_NoSectionError);
      PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_NoSectionError);
      __Pyx_INCREF(__pyx_n_s_DEFAULTSECT);
      __Pyx_GIVEREF(__pyx_n_s_DEFAULTSECT);
      PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_DEFAULTSECT);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_configparser, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_RawConfigParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_RawConfigParser, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SafeConfigParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SafeConfigParser, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConfigParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConfigParser, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_NoSectionError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoSectionError, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_DEFAULTSECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULTSECT, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/monal/util/toolbox.py":47
 * from .. import monalconst as C
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from configparser import RawConfigParser, SafeConfigParser, ConfigParser, \
 *         NoSectionError, DEFAULTSECT
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/monal/util/toolbox.py":50
 *     from configparser import RawConfigParser, SafeConfigParser, ConfigParser, \
 *         NoSectionError, DEFAULTSECT
 * except ImportError:             # <<<<<<<<<<<<<<
 *     from ConfigParser import RawConfigParser, SafeConfigParser, ConfigParser, \
 *         NoSectionError, DEFAULTSECT
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("metaphor.monal.util.toolbox", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 50, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);

      /* "metaphor/monal/util/toolbox.py":51
 *         NoSectionError, DEFAULTSECT
 * except ImportError:
 *     from ConfigParser import RawConfigParser, SafeConfigParser, ConfigParser, \             # <<<<<<<<<<<<<<
 *         NoSectionError, DEFAULTSECT
 *  #import collections
 */
      __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_n_s_RawConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_RawConfigParser);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_RawConfigParser);
      __Pyx_INCREF(__pyx_n_s_SafeConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_SafeConfigParser);
      PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SafeConfigParser);
      __Pyx_INCREF(__pyx_n_s_ConfigParser);
      __Pyx_GIVEREF(__pyx_n_s_ConfigParser);
      PyList_SET_ITEM(__pyx_t_8, 2, __pyx_n_s_ConfigParser);
      __Pyx_INCREF(__pyx_n_s_NoSectionError);
      __Pyx_GIVEREF(__pyx_n_s_NoSectionError);
      PyList_SET_ITEM(__pyx_t_8, 3, __pyx_n_s_NoSectionError);
      __Pyx_INCREF(__pyx_n_s_DEFAULTSECT);
      __Pyx_GIVEREF(__pyx_n_s_DEFAULTSECT);
      PyList_SET_ITEM(__pyx_t_8, 4, __pyx_n_s_DEFAULTSECT);
      __pyx_t_9 = __Pyx_Import(__pyx_n_s_ConfigParser, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_RawConfigParser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_RawConfigParser, __pyx_t_8) < 0) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_SafeConfigParser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SafeConfigParser, __pyx_t_8) < 0) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_ConfigParser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConfigParser, __pyx_t_8) < 0) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_NoSectionError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoSectionError, __pyx_t_8) < 0) __PYX_ERR(0, 52, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_DEFAULTSECT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULTSECT, __pyx_t_8) < 0) __PYX_ERR(0, 52, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_except_error:;

    /* "metaphor/monal/util/toolbox.py":47
 * from .. import monalconst as C
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from configparser import RawConfigParser, SafeConfigParser, ConfigParser, \
 *         NoSectionError, DEFAULTSECT
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L7_try_end:;
  }

  /* "metaphor/monal/util/toolbox.py":55
 *  #import collections
 * 
 * def homedir():             # <<<<<<<<<<<<<<
 *     return os.path.expanduser(chr(126))
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_1homedir, 0, __pyx_n_s_homedir, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_homedir, __pyx_t_7) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":58
 *     return os.path.expanduser(chr(126))
 * 
 * global_cache = {}             # <<<<<<<<<<<<<<
 * def cached_listdir(path):
 *     """Substitute of dircache.listdir for python 3.X
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_cache, __pyx_t_7) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":59
 * 
 * global_cache = {}
 * def cached_listdir(path):             # <<<<<<<<<<<<<<
 *     """Substitute of dircache.listdir for python 3.X
 *     """
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_3cached_listdir, 0, __pyx_n_s_cached_listdir, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cached_listdir, __pyx_t_7) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":89
 * #     return lst1, lst2
 * 
 * def cmp_to_key(mycmp):             # <<<<<<<<<<<<<<
 *     'Convert a cmp= function into a key= function'
 *     class K(object):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_5cmp_to_key, 0, __pyx_n_s_cmp_to_key, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cmp_to_key, __pyx_t_7) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":108
 *     return K
 * 
 * tilde = chr(0x007E)             # <<<<<<<<<<<<<<
 * escape_dict={'\a':r'\a',
 *            '\b':r'\b',
 */
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tilde, __pyx_t_7) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":109
 * 
 * tilde = chr(0x007E)
 * escape_dict={'\a':r'\a',             # <<<<<<<<<<<<<<
 *            '\b':r'\b',
 *            '\c':r'\c',
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__85, __pyx_kp_u_a_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__86, __pyx_kp_u_b_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_c_3, __pyx_kp_u_c_3) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__87, __pyx_kp_u_f) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__20, __pyx_kp_u_n) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__88, __pyx_kp_u_r_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__67, __pyx_kp_u_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__89, __pyx_kp_u_v) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__90, __pyx_kp_u__91) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__92, __pyx_kp_u__93) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__94, __pyx_kp_u_0_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__95, __pyx_kp_u_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__96, __pyx_kp_u_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__97, __pyx_kp_u_3) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__98, __pyx_kp_u_4) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__99, __pyx_kp_u_5) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__100, __pyx_kp_u_6) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u__85, __pyx_kp_u_7) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_8, __pyx_kp_u_8) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_9, __pyx_kp_u_9) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_escape_dict, __pyx_t_7) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":142
 * #     return st
 * #
 * def setTrainingActionParams(config, propertyname, initCount=1, initstddev=0.3,             # <<<<<<<<<<<<<<
 *         epochs=0, resultdir="", seed=0, criterion=C.TCR_NOSORT, **kwd):
 *     """Introducing the training parameters in the configuration object.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_7setTrainingActionParams, 0, __pyx_n_s_setTrainingActionParams, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 142, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":143
 * #
 * def setTrainingActionParams(config, propertyname, initCount=1, initstddev=0.3,
 *         epochs=0, resultdir="", seed=0, criterion=C.TCR_NOSORT, **kwd):             # <<<<<<<<<<<<<<
 *     """Introducing the training parameters in the configuration object.
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TCR_NOSORT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_criterion = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_8metaphor_5monal_4util_7toolbox_165__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setTrainingActionParams, __pyx_t_7) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":185
 *     return config
 * 
 * def raw(text):             # <<<<<<<<<<<<<<
 *     """Returns a raw string representation of text"""
 *     return "".join([escape_dict.get(char, char) for char in text])
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_9raw, 0, __pyx_n_s_raw, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_raw, __pyx_t_7) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":189
 *     return "".join([escape_dict.get(char, char) for char in text])
 * 
 * class idemDefaultDict(dict):             # <<<<<<<<<<<<<<
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)(&PyDict_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyDict_Type)));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyDict_Type)));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_7, __pyx_n_s_idemDefaultDict, __pyx_n_s_idemDefaultDict, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_kp_s_Dictionnaire_dont_la_valeur_par); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "metaphor/monal/util/toolbox.py":192
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 *     def __init__(self, *args, **argv):             # <<<<<<<<<<<<<<
 *         super(idemDefaultDict, self).__init__()
 *         self.update(*args, **argv)
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_1__init__, 0, __pyx_n_s_idemDefaultDict___init, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "metaphor/monal/util/toolbox.py":196
 *         self.update(*args, **argv)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         try:
 *             return super(idemDefaultDict, self).__getitem__(key)
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_15idemDefaultDict_3__getitem__, 0, __pyx_n_s_idemDefaultDict___getitem, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_9) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "metaphor/monal/util/toolbox.py":189
 *     return "".join([escape_dict.get(char, char) for char in text])
 * 
 * class idemDefaultDict(dict):             # <<<<<<<<<<<<<<
 *     """Dictionnaire dont la valeur par dfaut est la valeur de la cl presente.
 *     """
 */
  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_idemDefaultDict, __pyx_t_7, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_idemDefaultDict, __pyx_t_9) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":212
 * #     return val
 * 
 * def lookInTree(filename, base):             # <<<<<<<<<<<<<<
 *     if not isinstance(base, str):
 *         base = base.__paths__[0]
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_11lookInTree, 0, __pyx_n_s_lookInTree, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookInTree, __pyx_t_7) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":223
 * #                 return st
 * 
 * def lookForFile(filename, package, module="", optional="", abspath=False, locationpath=""):             # <<<<<<<<<<<<<<
 *     """Recherche un fichier dans un package, et dans les enfants de ses ancetres
 *     portant le meme nom
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_13lookForFile, 0, __pyx_n_s_lookForFile, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__113);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookForFile, __pyx_t_7) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":283
 *         return test
 * 
 * def addpathlist(source, packagename, lst):             # <<<<<<<<<<<<<<
 *     if source:
 *         dirr, base = os.path.split(source)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_15addpathlist, 0, __pyx_n_s_addpathlist, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_addpathlist, __pyx_t_7) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":296
 *     return lst
 * 
 * def getconfigfile(filesource, candidate, modname=""):             # <<<<<<<<<<<<<<
 *     configfile = ""
 *     for val in sys.argv:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_17getconfigfile, 0, __pyx_n_s_getconfigfile, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__118);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getconfigfile, __pyx_t_7) < 0) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":307
 *     return configfile
 * 
 * def getOptions(configfile, section):             # <<<<<<<<<<<<<<
 *     defconf = defaultedConfigParser(configfile)
 *     res = {}
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_19getOptions, 0, __pyx_n_s_getOptions, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getOptions, __pyx_t_7) < 0) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":331
 * #     return retcode
 * 
 * def getexecparam(*args, **kwarg):             # <<<<<<<<<<<<<<
 *     """lance un executable, et retourne les premires lignes de la rponse
 *     """
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_21getexecparam, 0, __pyx_n_s_getexecparam, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getexecparam, __pyx_t_7) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":367
 * # timefmtlist = ["%H:%M:%S", "%H:%M", "%H", "%Hh%Mm%S", "%Hh%M"]
 * 
 * class textwriter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, target):
 *         super(textwriter, self).__init__()
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__123); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__123, __pyx_n_s_textwriter, __pyx_n_s_textwriter, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "metaphor/monal/util/toolbox.py":368
 * 
 * class textwriter(object):
 *     def __init__(self, target):             # <<<<<<<<<<<<<<
 *         super(textwriter, self).__init__()
 *         self.target = target
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_1__init__, 0, __pyx_n_s_textwriter___init, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":372
 *         self.target = target
 * 
 *     def writeImage(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         try:
 *             self.target.WriteImage(*args, **kwds)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_3writeImage, 0, __pyx_n_s_textwriter_writeImage, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_writeImage, __pyx_t_2) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":379
 *             print (err)
 * 
 *     def write(self, *args, **kwds):             # <<<<<<<<<<<<<<
 *         test = "color" in kwds
 *         if test:
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_5write, 0, __pyx_n_s_textwriter_write, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":408
 *         return res
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_10textwriter_7flush, 0, __pyx_n_s_textwriter_flush, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_flush, __pyx_t_2) < 0) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/monal/util/toolbox.py":367
 * # timefmtlist = ["%H:%M:%S", "%H:%M", "%H", "%Hh%Mm%S", "%Hh%M"]
 * 
 * class textwriter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, target):
 *         super(textwriter, self).__init__()
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_textwriter, __pyx_tuple__123, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_textwriter, __pyx_t_2) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":411
 *         pass
 * 
 * def run_script(script_name, script_args=None):             # <<<<<<<<<<<<<<
 *     save_argv = sys.argv[:]
 *     g = {'__file__': script_name}
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_23run_script, 0, __pyx_n_s_run_script, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__134);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_script, __pyx_t_7) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":432
 *         raise
 * 
 * def dupescape(source):             # <<<<<<<<<<<<<<
 *     lst = source.split('\\')
 *     return '\\\\'.join(lst)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_25dupescape, 0, __pyx_n_s_dupescape, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dupescape, __pyx_t_7) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":436
 *     return '\\\\'.join(lst)
 * 
 * def add2path(directory):             # <<<<<<<<<<<<<<
 *     #import sys
 *     directory = os.path.normpath(directory)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_27add2path, 0, __pyx_n_s_add2path, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_add2path, __pyx_t_7) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":446
 *     lst.insert(1, directory)
 * 
 * def removelinewith(filename, test):             # <<<<<<<<<<<<<<
 *     lst2 = []
 *     if os.path.exists(filename):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_29removelinewith, 0, __pyx_n_s_removelinewith, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_removelinewith, __pyx_t_7) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":456
 *             f.write(st)
 * 
 * def adduniqueline(line, filename):             # <<<<<<<<<<<<<<
 *     OK = not os.path.exists(filename)
 *     if not OK:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_31adduniqueline, 0, __pyx_n_s_adduniqueline, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_adduniqueline, __pyx_t_7) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":472
 *             f.write("\n")
 * 
 * def analyserange(rangestr):             # <<<<<<<<<<<<<<
 *     #analyse d'un libelle de plage excel
 *     lst = rangestr.split("!")
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_33analyserange, 0, __pyx_n_s_analyserange, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_analyserange, __pyx_t_7) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":483
 *     return rangestr, worksheetstr
 * 
 * def getfiletype(path):             # <<<<<<<<<<<<<<
 *     st = os.path.splitext(path)[1]
 *     if st:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_35getfiletype, 0, __pyx_n_s_getfiletype, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getfiletype, __pyx_t_7) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":489
 *     return st
 * 
 * def make_dir(dir_path, doprint=False, writer=sys.stdout, forbidden=[]):             # <<<<<<<<<<<<<<
 *     """Wrapper for os.mkdir, that will not fail if directory
 *     already exists.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_37make_dir, 0, __pyx_n_s_make_dir, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults1), 2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_7)->__pyx_arg_writer = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_7)->__pyx_arg_forbidden = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_8metaphor_5monal_4util_7toolbox_167__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_dir, __pyx_t_7) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":548
 * #         writer.write("cleaning %s\n"% dname)
 * 
 * def tempDir(name=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     if name:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_39tempDir, 0, __pyx_n_s_tempDir, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__151);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempDir, __pyx_t_7) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":554
 *     return mydir
 * 
 * def tempFileName(length=3, prefix="", suffix=""):             # <<<<<<<<<<<<<<
 *     mydir = tempfile.gettempdir()
 *     st = os.path.join(mydir, "%s%s%s" %(prefix, aleastr(length), suffix))
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_41tempFileName, 0, __pyx_n_s_tempFileName, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__154);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempFileName, __pyx_t_7) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":561
 *     return st
 * 
 * def getPythonPath():             # <<<<<<<<<<<<<<
 *     try:
 *         return os.environ["PYTHONPATH"].split(";")
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_43getPythonPath, 0, __pyx_n_s_getPythonPath, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getPythonPath, __pyx_t_7) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":575
 *         return lst[n]
 * 
 * def addPythonPath(path, before=True):             # <<<<<<<<<<<<<<
 *     if not path: return
 *     cur = os.environ["PYTHONPATH"]
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_45addPythonPath, 0, __pyx_n_s_addPythonPath, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__159);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_addPythonPath, __pyx_t_7) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":610
 * #     return ";".join(dataToStrList(source, dateindex, decimal)) + "\n"
 * 
 * def slicexrange(aslice):             # <<<<<<<<<<<<<<
 *     if aslice.step is None: return list(range(int(aslice.start), aslice.stop))
 *     else: return list(range(int(aslice.start), aslice.stop, aslice.step))
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_47slicexrange, 0, __pyx_n_s_slicexrange, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_slicexrange, __pyx_t_7) < 0) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":642
 * #     return max(date1, date2)
 * 
 * def alllist(source, sep=";"):             # <<<<<<<<<<<<<<
 *     try:
 *         try: return [val.strip() for val in source.split(sep)]
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_49alllist, 0, __pyx_n_s_alllist, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__164);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_alllist, __pyx_t_7) < 0) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":648
 *     except: return source
 * 
 * def isfield(source):             # <<<<<<<<<<<<<<
 *     """test de l'etat de champ de modele"""
 *     test = r"\[\d+\]\Z"
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_51isfield, 0, __pyx_n_s_isfield, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isfield, __pyx_t_7) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":663
 *     except: return False
 * 
 * def splitfield(source):             # <<<<<<<<<<<<<<
 *     """eclatement d'un nom de champ de modele entre nom brut et retard"""
 *     source = source.strip()
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_53splitfield, 0, __pyx_n_s_splitfield, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_splitfield, __pyx_t_7) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":685
 *     return None, None
 * 
 * def rrange(start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *     if not step:
 *         step = 1.0
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_55rrange, 0, __pyx_n_s_rrange, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__170);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rrange, __pyx_t_7) < 0) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":699
 *     raise StopIteration
 * 
 * def boolstr(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str):
 *         try:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_58boolstr, 0, __pyx_n_s_boolstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_boolstr, __pyx_t_7) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":707
 * 
 * 
 * def isnum(key):             # <<<<<<<<<<<<<<
 *     return isinstance(key, int)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_60isnum, 0, __pyx_n_s_isnum, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnum, __pyx_t_7) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":710
 *     return isinstance(key, int)
 * 
 * def appendex(lst, value):             # <<<<<<<<<<<<<<
 *     """extension de 'append' sans doublon"""
 *     try:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_62appendex, 0, __pyx_n_s_appendex, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_appendex, __pyx_t_7) < 0) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":718
 *         return lst.index(value)
 * 
 * def NDKdllName(levelmax=3, direct=False):             # <<<<<<<<<<<<<<
 *     #import sys
 *     alevel = levelmax
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_64NDKdllName, 0, __pyx_n_s_NDKdllName, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__179);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NDKdllName, __pyx_t_7) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":737
 *     return res, alevel
 * 
 * def namefromfilename(filename):             # <<<<<<<<<<<<<<
 *     result = os.path.split(filename)[1]
 *     result = '.'.join(result.split('.')[:-1])
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_66namefromfilename, 0, __pyx_n_s_namefromfilename, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_namefromfilename, __pyx_t_7) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":742
 *     return result
 * 
 * def inttohexstr(value, lmin=2):             # <<<<<<<<<<<<<<
 *     res = hex(value)[2:]
 *     res = "0"*(lmin - len(res)) + res
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_68inttohexstr, 0, __pyx_n_s_inttohexstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__184);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inttohexstr, __pyx_t_7) < 0) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":747
 *     return res
 * 
 * def hexstrtoint(value):             # <<<<<<<<<<<<<<
 *     return int(value, 16)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_70hexstrtoint, 0, __pyx_n_s_hexstrtoint, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hexstrtoint, __pyx_t_7) < 0) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":750
 *     return int(value, 16)
 * 
 * def aleastr(ll):             # <<<<<<<<<<<<<<
 *     res = ""
 *     while len(res) < ll:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_72aleastr, 0, __pyx_n_s_aleastr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_aleastr, __pyx_t_7) < 0) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":757
 *     return res
 * 
 * def strtolen(value, length):             # <<<<<<<<<<<<<<
 *     res = str(value)[:length]
 *     if len(res) < length:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_74strtolen, 0, __pyx_n_s_strtolen, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strtolen, __pyx_t_7) < 0) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":763
 *     return res
 * 
 * def interrogate(item):             # <<<<<<<<<<<<<<
 *     """Print useful information about item."""
 *     if hasattr(item, '__name__'):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_76interrogate, 0, __pyx_n_s_interrogate, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_interrogate, __pyx_t_7) < 0) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":807
 * #    else:
 * #        return (target[: n], target[n: n+len(sep)], target[n+len(sep):])
 * def datelong(datestr):             # <<<<<<<<<<<<<<
 *     def setlen2(st):
 *         if len(st) >= 2:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_78datelong, 0, __pyx_n_s_datelong, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datelong, __pyx_t_7) < 0) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":825
 *     return ' '.join([st] + mem[1:])
 * 
 * def strCommon(A, B, caseSensitive = True):             # <<<<<<<<<<<<<<
 *     if not caseSensitive:
 *         A = A.lower()
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_80strCommon, 0, __pyx_n_s_strCommon, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__197);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strCommon, __pyx_t_7) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":880
 * #     return cmpstr(X, Y, getext)#lambda st: rpartition(st, '.')[2]
 * 
 * def getFilesByExt(directory, ext='', casesensitive=True):             # <<<<<<<<<<<<<<
 *     """ retourne un iterateur sur les fichiers du dossier 'directory' qui se terminent par 'ext'."""
 *     if not casesensitive:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_82getFilesByExt, 0, __pyx_n_s_getFilesByExt, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__199);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getFilesByExt, __pyx_t_7) < 0) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":893
 *             yield df
 * 
 * class IndexValueError(IndexError):             # <<<<<<<<<<<<<<
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__200); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__200, __pyx_n_s_IndexValueError, __pyx_n_s_IndexValueError, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "metaphor/monal/util/toolbox.py":894
 * 
 * class IndexValueError(IndexError):
 *     _index = None             # <<<<<<<<<<<<<<
 *     def __init__(self, index=0xFF, mess=''):
 *         IndexError.__init__(self, mess)
 */
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_index_2, Py_None) < 0) __PYX_ERR(0, 894, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":895
 * class IndexValueError(IndexError):
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):             # <<<<<<<<<<<<<<
 *         IndexError.__init__(self, mess)
 *         self._index = index
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_1__init__, 0, __pyx_n_s_IndexValueError___init, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__203);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":898
 *         IndexError.__init__(self, mess)
 *         self._index = index
 *     index = property(lambda self: self._index)             # <<<<<<<<<<<<<<
 * 
 * def getIndexInVector(value, vector):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_15IndexValueError_2lambda, 0, __pyx_n_s_IndexValueError_lambda, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_index, __pyx_t_9) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "metaphor/monal/util/toolbox.py":893
 *             yield df
 * 
 * class IndexValueError(IndexError):             # <<<<<<<<<<<<<<
 *     _index = None
 *     def __init__(self, index=0xFF, mess=''):
 */
  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_IndexValueError, __pyx_tuple__200, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IndexValueError, __pyx_t_9) < 0) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":900
 *     index = property(lambda self: self._index)
 * 
 * def getIndexInVector(value, vector):             # <<<<<<<<<<<<<<
 *     """Recherche de l'indice d'un parametre du vecteur.
 * Lorsque le parametre est connu par son nom, on determine son indice en
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_85getIndexInVector, 0, __pyx_n_s_getIndexInVector, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getIndexInVector, __pyx_t_7) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":912
 *     return -1
 * 
 * def getCVector(values, dim):             # <<<<<<<<<<<<<<
 *     try:
 *         if (dim == 1) and isinstance(values, (int, float)):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_87getCVector, 0, __pyx_n_s_getCVector, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getCVector, __pyx_t_7) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":928
 *     except: return None
 * 
 * def product(iterator, init=1):             # <<<<<<<<<<<<<<
 *     res = init
 *     for val in iterator: res *= val
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_89product, 0, __pyx_n_s_product, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__210);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_product, __pyx_t_7) < 0) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":949
 * #def justify(source, ):
 * 
 * def getindexstr(target, index, Func):             # <<<<<<<<<<<<<<
 *     """Lecture dans une bibliotheque d'une valeur string indexee. La fonction
 * Func doit retourner la longueur de la chaine lorsqu'elle est appelee avec une
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_91getindexstr, 0, __pyx_n_s_getindexstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getindexstr, __pyx_t_7) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":958
 *     return targ.value
 * 
 * def get2indexstr(index1, index2, Func):             # <<<<<<<<<<<<<<
 *     try:
 *         dim = Func(None, index1, index2)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_93get2indexstr, 0, __pyx_n_s_get2indexstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get2indexstr, __pyx_t_7) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":974
 * #            return os.path.join(res[0], filename)
 * 
 * def LoadConfig(myfile, config={}):             # <<<<<<<<<<<<<<
 *     """Returns a dictionary with key's of the form
 * <section>.<option> and the values."""
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_95LoadConfig, 0, __pyx_n_s_LoadConfig, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 974, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_7)->__pyx_arg_config = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_8metaphor_5monal_4util_7toolbox_169__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LoadConfig, __pyx_t_7) < 0) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":989
 *     return config
 * 
 * def checkIndex(val, minincluded, maxexcluded):             # <<<<<<<<<<<<<<
 *     assert(minincluded <= val < maxexcluded)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_97checkIndex, 0, __pyx_n_s_checkIndex, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkIndex, __pyx_t_7) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":992
 *     assert(minincluded <= val < maxexcluded)
 * 
 * def listorstr(cible, sep=';'):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, str):
 *         return cible.split(sep)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_99listorstr, 0, __pyx_n_s_listorstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__221);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_listorstr, __pyx_t_7) < 0) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":997
 *     return str(cible)
 * 
 * def listorint(cible):             # <<<<<<<<<<<<<<
 *     if isinstance(cible, int):
 *         return [cible]
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_101listorint, 0, __pyx_n_s_listorint, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_listorint, __pyx_t_7) < 0) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1002
 *     return cible
 * 
 * def shiftText(text, shft):             # <<<<<<<<<<<<<<
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_103shiftText, 0, __pyx_n_s_shiftText, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shiftText, __pyx_t_7) < 0) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1005
 *     return '\n'.join([shft + st for st in text.splitlines()])
 * 
 * def dothread(func):             # <<<<<<<<<<<<<<
 *     import threading
 *     # deco rator permettant de lancer une fonction dans un thread spar
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_105dothread, 0, __pyx_n_s_dothread, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dothread, __pyx_t_7) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1013
 *     return wrapper
 * 
 * def fileexists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isfile(path)  #and os.path.exists(path)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_107fileexists, 0, __pyx_n_s_fileexists, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fileexists, __pyx_t_7) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1020
 *     return True
 * 
 * def direxists(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, str):
 *         return os.path.isdir(path)  #and os.path.exists(path)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_109direxists, 0, __pyx_n_s_direxists, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_direxists, __pyx_t_7) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1027
 *     return True
 * 
 * def checkFile(path, full=False):             # <<<<<<<<<<<<<<
 *     res = os.path.isfile(path)
 *     if full: assert res ("file %s does not exists" % path)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_111checkFile, 0, __pyx_n_s_checkFile, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__234);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkFile, __pyx_t_7) < 0) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1031
 *     if full: assert res ("file %s does not exists" % path)
 *     return res
 * CheckFile = checkFile             # <<<<<<<<<<<<<<
 * 
 * def fullFileName(value, chemin):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_checkFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CheckFile, __pyx_t_7) < 0) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1033
 * CheckFile = checkFile
 * 
 * def fullFileName(value, chemin):             # <<<<<<<<<<<<<<
 *     if (chemin == '') or (value == ''):
 *         return value
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_113fullFileName, 0, __pyx_n_s_fullFileName, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fullFileName, __pyx_t_7) < 0) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1041
 *             value = res[1]
 *         return os.path.join(chemin, value)
 * FullFileName = fullFileName             # <<<<<<<<<<<<<<
 * 
 * #def sourceDefaulted(source, default):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_fullFileName); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FullFileName, __pyx_t_7) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1187
 * # DateTimeToStr = dateTimeToStr
 * 
 * def addToFileName(filename, addstr):             # <<<<<<<<<<<<<<
 *     name, ext = os.path.split(filename)
 *     return "%s%s%s" %(name, addstr, ext)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_115addToFileName, 0, __pyx_n_s_addToFileName, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_addToFileName, __pyx_t_7) < 0) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1191
 *     return "%s%s%s" %(name, addstr, ext)
 * 
 * def regFile(source, ext):             # <<<<<<<<<<<<<<
 *     n = source.rfind('.')
 *     if (n > 0): return source[:n] + '_R' + ext
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_117regFile, 0, __pyx_n_s_regFile, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_regFile, __pyx_t_7) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1195
 *     if (n > 0): return source[:n] + '_R' + ext
 *     return source + '_R' + ext
 * RegFile = regFile             # <<<<<<<<<<<<<<
 * 
 * # def DoubleBlanc(source):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_regFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RegFile, __pyx_t_7) < 0) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1218
 * # NouvelleListe = nouvelleListe = NewList = newList
 * 
 * def ContainsAny(seq, aset):             # <<<<<<<<<<<<<<
 *     for c in seq:
 *         if c in aset:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_119ContainsAny, 0, __pyx_n_s_ContainsAny, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ContainsAny, __pyx_t_7) < 0) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1224
 *     return False
 * 
 * def selectedData(data, select, default=None):             # <<<<<<<<<<<<<<
 *     if select: return data
 *     return default
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_121selectedData, 0, __pyx_n_s_selectedData, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__245);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_selectedData, __pyx_t_7) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1228
 *     return default
 * 
 * def hasBoolValue(llist, value):             # <<<<<<<<<<<<<<
 *     for tt in llist:
 *         if not tt ^ value: return True
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_123hasBoolValue, 0, __pyx_n_s_hasBoolValue, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hasBoolValue, __pyx_t_7) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1233
 *     return False
 * 
 * def IsValidHour(timestr, fmt="%H:%M"):             # <<<<<<<<<<<<<<
 *     try:
 *         time.strptime(timestr, fmt)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_125IsValidHour, 0, __pyx_n_s_IsValidHour, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__250);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IsValidHour, __pyx_t_7) < 0) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1291
 * #         return data
 * 
 * def isiterable(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, str): return False
 *     try:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_127isiterable, 0, __pyx_n_s_isiterable, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isiterable, __pyx_t_7) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1299
 *         return False
 * 
 * def stlen(value):             # <<<<<<<<<<<<<<
 *     return value, len(value)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_129stlen, 0, __pyx_n_s_stlen, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stlen, __pyx_t_7) < 0) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1302
 *     return value, len(value)
 * 
 * def joinEx(sep, iterator, limited=False, fillchar=' '):             # <<<<<<<<<<<<<<
 *     def modifiedstr(value, sep, lim):
 *         st = str(value).ljust(sep, fillchar)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_131joinEx, 0, __pyx_n_s_joinEx, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__257);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_joinEx, __pyx_t_7) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1316
 *             return ''.join(modifiedstr(val, sepl, limited) for sepl, val in zip(sep, iterator))
 * 
 * def createAleaTable(nline = 1, nperline = 1, absmax=1.0):             # <<<<<<<<<<<<<<
 *     result = []
 *     for _ in range(nline):  #i
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_133createAleaTable, 0, __pyx_n_s_createAleaTable, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__260);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_createAleaTable, __pyx_t_7) < 0) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1322
 *     return result
 * 
 * def printnl(val, nl=1):             # <<<<<<<<<<<<<<
 *     print((val + "\n"*nl))
 * #    for i in xrange(nl):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_135printnl, 0, __pyx_n_s_printnl, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__263);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_printnl, __pyx_t_7) < 0) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1327
 * #        print
 * 
 * def printdoc(obj):             # <<<<<<<<<<<<<<
 *     lst= dir(obj)
 *     for value in lst:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_137printdoc, 0, __pyx_n_s_printdoc, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_printdoc, __pyx_t_7) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1336
 *             print(value)
 * 
 * def PrettyPrintDic(dic, intro, inter='', dico2=None):             # <<<<<<<<<<<<<<
 *     """Bel imprimeur de distionnaire
 *   - intro prcde chaque ligne
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_139PrettyPrintDic, 0, __pyx_n_s_PrettyPrintDic, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__268);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PrettyPrintDic, __pyx_t_7) < 0) __PYX_ERR(0, 1336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1352
 * #     return not any(val1 != val2 for val1, val2 in zip( lst1, lst2 ))
 * 
 * def FalseToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if not cond: return ''
 *     return value
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_141FalseToEmpty, 0, __pyx_n_s_FalseToEmpty, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FalseToEmpty, __pyx_t_7) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1355
 *     if not cond: return ''
 *     return value
 * def TrueToEmpty(value, cond):             # <<<<<<<<<<<<<<
 *     if cond: return ''
 *     return value
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_143TrueToEmpty, 0, __pyx_n_s_TrueToEmpty, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TrueToEmpty, __pyx_t_7) < 0) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1359
 *     return value
 * 
 * def dataIterator(titles, *iterlist):             # <<<<<<<<<<<<<<
 *     yield list(titles)
 *     #ll = len(iterlist)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_145dataIterator, 0, __pyx_n_s_dataIterator, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dataIterator, __pyx_t_7) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1365
 *         yield(list(vallist))
 * 
 * def nonZeroToOne(val):             # <<<<<<<<<<<<<<
 *     if val != 0:
 *         return 1
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_148nonZeroToOne, 0, __pyx_n_s_nonZeroToOne, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nonZeroToOne, __pyx_t_7) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1370
 *     return 0
 * 
 * def reversed_enumerate(iterable):             # <<<<<<<<<<<<<<
 *     try:
 *         n = len(iterable)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_150reversed_enumerate, 0, __pyx_n_s_reversed_enumerate, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reversed_enumerate, __pyx_t_7) < 0) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1381
 *         yield n, val
 * 
 * def _linkstr(a, b, c="", linker="_"):             # <<<<<<<<<<<<<<
 *     if c:
 *         return "%s%s%s%s%s" % (a, linker, b, linker, c)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_153_linkstr, 0, __pyx_n_s_linkstr, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__279);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_linkstr, __pyx_t_7) < 0) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1412
 * #
 * #----------------------------------------------------------------------------
 * import functools             # <<<<<<<<<<<<<<
 * 
 * def singleton2(cls):
 */
  __pyx_t_7 = __Pyx_Import(__pyx_n_s_functools, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_functools, __pyx_t_7) < 0) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1414
 * import functools
 * 
 * def singleton2(cls):             # <<<<<<<<<<<<<<
 *     instance = cls()
 *     instance.__call__ = lambda: instance
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_155singleton2, 0, __pyx_n_s_singleton2, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_singleton2, __pyx_t_7) < 0) __PYX_ERR(0, 1414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1419
 *     return instance
 * 
 * def singleton(cls):             # <<<<<<<<<<<<<<
 *     ''' Use class as singleton. '''
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_157singleton, 0, __pyx_n_s_singleton, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_singleton, __pyx_t_7) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1440
 *     return cls
 * 
 * class autoprop(type):             # <<<<<<<<<<<<<<
 *     """autoprop : metaclasse definissant automatiquement les proprietes.
 * 
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)(&PyType_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyType_Type)));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_7, __pyx_n_s_autoprop, __pyx_n_s_autoprop, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_kp_s_autoprop_metaclasse_definissant); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "metaphor/monal/util/toolbox.py":1446
 * _set_xxx, _del_xxx ou _doc_xxx sous le nom xxx. Puis il declare les proprietes
 * de nom xxx avec les fonctions d'acces correspondantes."""
 *     def __init__(cls, name, bases, dico):             # <<<<<<<<<<<<<<
 *         super(autoprop, cls).__init__(name, bases, dico)
 *         props = {}
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_8autoprop_1__init__, 0, __pyx_n_s_autoprop___init, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/monal/util/toolbox.py":1440
 *     return cls
 * 
 * class autoprop(type):             # <<<<<<<<<<<<<<
 *     """autoprop : metaclasse definissant automatiquement les proprietes.
 * 
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_autoprop, __pyx_t_7, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autoprop, __pyx_t_1) < 0) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1474
 * #     if ('file' in kwd) and (kwd['file'] is not None):
 * #         print(*objects, **kwd)
 * class bcolors:             # <<<<<<<<<<<<<<
 *     HEADER = '\033[95m'
 *     OKBLUE = '\033[94m'
 */
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_bcolors, __pyx_n_s_bcolors, (PyObject *) NULL, __pyx_n_s_metaphor_monal_util_toolbox, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "metaphor/monal/util/toolbox.py":1475
 * #         print(*objects, **kwd)
 * class bcolors:
 *     HEADER = '\033[95m'             # <<<<<<<<<<<<<<
 *     OKBLUE = '\033[94m'
 *     OKGREEN = '\033[92m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_HEADER, __pyx_kp_u_95m) < 0) __PYX_ERR(0, 1475, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1476
 * class bcolors:
 *     HEADER = '\033[95m'
 *     OKBLUE = '\033[94m'             # <<<<<<<<<<<<<<
 *     OKGREEN = '\033[92m'
 *     WARNING = '\033[93m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_OKBLUE, __pyx_kp_u_94m) < 0) __PYX_ERR(0, 1476, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1477
 *     HEADER = '\033[95m'
 *     OKBLUE = '\033[94m'
 *     OKGREEN = '\033[92m'             # <<<<<<<<<<<<<<
 *     WARNING = '\033[93m'
 *     FAIL = '\033[91m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_OKGREEN, __pyx_kp_u_92m) < 0) __PYX_ERR(0, 1477, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1478
 *     OKBLUE = '\033[94m'
 *     OKGREEN = '\033[92m'
 *     WARNING = '\033[93m'             # <<<<<<<<<<<<<<
 *     FAIL = '\033[91m'
 *     ENDC = '\033[0m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_WARNING, __pyx_kp_u_93m) < 0) __PYX_ERR(0, 1478, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1479
 *     OKGREEN = '\033[92m'
 *     WARNING = '\033[93m'
 *     FAIL = '\033[91m'             # <<<<<<<<<<<<<<
 *     ENDC = '\033[0m'
 *     BOLD = '\033[1m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_FAIL, __pyx_kp_u_91m) < 0) __PYX_ERR(0, 1479, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1480
 *     WARNING = '\033[93m'
 *     FAIL = '\033[91m'
 *     ENDC = '\033[0m'             # <<<<<<<<<<<<<<
 *     BOLD = '\033[1m'
 *     UNDERLINE = '\033[4m'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_ENDC, __pyx_kp_u_0m) < 0) __PYX_ERR(0, 1480, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1481
 *     FAIL = '\033[91m'
 *     ENDC = '\033[0m'
 *     BOLD = '\033[1m'             # <<<<<<<<<<<<<<
 *     UNDERLINE = '\033[4m'
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_BOLD, __pyx_kp_u_1m) < 0) __PYX_ERR(0, 1481, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1482
 *     ENDC = '\033[0m'
 *     BOLD = '\033[1m'
 *     UNDERLINE = '\033[4m'             # <<<<<<<<<<<<<<
 * 
 * # class toPrint(object):
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_UNDERLINE, __pyx_kp_u_4m) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)

  /* "metaphor/monal/util/toolbox.py":1474
 * #     if ('file' in kwd) and (kwd['file'] is not None):
 * #         print(*objects, **kwd)
 * class bcolors:             # <<<<<<<<<<<<<<
 *     HEADER = '\033[95m'
 *     OKBLUE = '\033[94m'
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_bcolors, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bcolors, __pyx_t_2) < 0) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1506
 * #             pprint(*objects, **kwd)
 * 
 * def deletefilebyFonction(Fct=lambda x:0, root="", recursive=False):             # <<<<<<<<<<<<<<
 *     #ext = ext.lower()
 *     for root, dirs, files in os.walk(root):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_159deletefilebyFonction, 0, __pyx_n_s_deletefilebyFonction, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_164lambda7, 0, __pyx_n_s_deletefilebyFonction_locals_lamb, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_7)->__pyx_arg_Fct = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_8metaphor_5monal_4util_7toolbox_171__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deletefilebyFonction, __pyx_t_7) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1521
 *                 deletefilebyFonction(Fct, pth, True)
 * 
 * def binaries_directory():             # <<<<<<<<<<<<<<
 *     """Return the installation directory, or None"""
 *     if '--user' in sys.argv:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_161binaries_directory, 0, __pyx_n_s_binaries_directory, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binaries_directory, __pyx_t_7) < 0) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1541
 *     return None
 * 
 * def cleanfiles(root, ext):             # <<<<<<<<<<<<<<
 *     ext = ext.lower()
 *     Fct = lambda x: os.path.splitext(x)[1].lower() == ext
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_5monal_4util_7toolbox_163cleanfiles, 0, __pyx_n_s_cleanfiles, NULL, __pyx_n_s_metaphor_monal_util_toolbox, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanfiles, __pyx_t_7) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/monal/util/toolbox.py":1575
 * #     return countfield, cols, richestimated, richtestresidual
 * 
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_10) {
  }

  /* "metaphor/monal/util/toolbox.py":1
 * # -*- coding: UTF-8 -*-             # <<<<<<<<<<<<<<
 * #===============================================================================
 * # $Id: toolbox.py 4827 2018-11-03 10:32:46Z jeanluc $
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init metaphor.monal.util.toolbox", 0, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init metaphor.monal.util.toolbox");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    if (likely(result)) {
        Py_INCREF(result);
    } else if (unlikely(PyErr_Occurred())) {
        result = NULL;
    } else {
#else
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyObjectCall */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyCFunctionFastCall */
    #if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
    #if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCallMethO */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
    #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* RaiseArgTupleInvalid */
    static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
    static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
    static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectSetAttrStr */
    #if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* None */
    static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* CalculateMetaclass */
    static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* FetchCommonType */
    static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
    #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* Py3ClassCreate */
        static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* PyObjectCallNoArg */
        #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* UnpackUnboundCMethod */
          static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
          #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        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);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* SaveResetException */
          #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if PY_VERSION_HEX >= 0x030700A3
    *type = tstate->exc_state.exc_type;
    *value = tstate->exc_state.exc_value;
    *tb = tstate->exc_state.exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = type;
    tstate->exc_state.exc_value = value;
    tstate->exc_state.exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
          #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
          #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = local_type;
    tstate->exc_state.exc_value = local_value;
    tstate->exc_state.exc_traceback = local_tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* GetItemInt */
            static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* RaiseTooManyValuesToUnpack */
            static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
            static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
            static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
            static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* GetAttr */
            static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
            static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyObjectCallMethod1 */
            static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = NULL;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyCFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            args = PyTuple_New(2);
            if (unlikely(!args)) goto done;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
    goto done;
done:
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) return NULL;
    result = __Pyx__PyObject_CallMethod1(method, arg);
    Py_DECREF(method);
    return result;
}

/* append */
            static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyErrFetchRestore */
            #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* IterNext */
            static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_Occurred();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    PyErr_Format(PyExc_TypeError,
        "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
    if (likely(iternext)) {
#if CYTHON_USE_TYPE_SLOTS
        next = iternext(iterator);
        if (likely(next))
            return next;
        #if PY_VERSION_HEX >= 0x02070000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
        #endif
#else
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
#endif
    } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    }
#if !CYTHON_USE_TYPE_SLOTS
    else {
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
    }
#endif
    return __Pyx_PyIter_Next2Default(defval);
}

/* SliceObject */
            static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* KeywordStringCheck */
            static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* Import */
            static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

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

/* None */
            static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* SwapException */
            #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = *type;
    tstate->exc_state.exc_value = *value;
    tstate->exc_state.exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* CallUnboundCMethod2 */
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* py_dict_pop */
            static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
    if ((1)) {
        return _PyDict_Pop(d, key, default_value);
    } else
#endif
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key);
    }
}

/* SetItemInt */
            static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* SliceObject */
              static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

/* PyExec */
              static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
    return __Pyx_PyExec3(o, globals, NULL);
}
static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
    PyObject* result;
    PyObject* s = 0;
    char *code = 0;
    if (!globals || globals == Py_None) {
        globals = __pyx_d;
    } else if (!PyDict_Check(globals)) {
        PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s",
                     Py_TYPE(globals)->tp_name);
        goto bad;
    }
    if (!locals || locals == Py_None) {
        locals = globals;
    }
    if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) {
        if (PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0)
            goto bad;
    }
    if (PyCode_Check(o)) {
        if (__Pyx_PyCode_HasFreeVars((PyCodeObject *)o)) {
            PyErr_SetString(PyExc_TypeError,
                "code object passed to exec() may not contain free variables");
            goto bad;
        }
        #if CYTHON_COMPILING_IN_PYPY || PY_VERSION_HEX < 0x030200B1
        result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
        #else
        result = PyEval_EvalCode(o, globals, locals);
        #endif
    } else {
        PyCompilerFlags cf;
        cf.cf_flags = 0;
        if (PyUnicode_Check(o)) {
            cf.cf_flags = PyCF_SOURCE_IS_UTF8;
            s = PyUnicode_AsUTF8String(o);
            if (!s) goto bad;
            o = s;
        #if PY_MAJOR_VERSION >= 3
        } else if (!PyBytes_Check(o)) {
        #else
        } else if (!PyString_Check(o)) {
        #endif
            PyErr_Format(PyExc_TypeError,
                "exec: arg 1 must be string, bytes or code object, got %.200s",
                Py_TYPE(o)->tp_name);
            goto bad;
        }
        #if PY_MAJOR_VERSION >= 3
        code = PyBytes_AS_STRING(o);
        #else
        code = PyString_AS_STRING(o);
        #endif
        if (PyEval_MergeCompilerFlags(&cf)) {
            result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
        } else {
            result = PyRun_String(code, Py_file_input, globals, locals);
        }
        Py_XDECREF(s);
    }
    return result;
bad:
    Py_XDECREF(s);
    return 0;
}

/* PyObjectFormatAndDecref */
              static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
              static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyIntBinop */
              #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* ObjectGetItem */
              #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* RaiseException */
              #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* BytesEquals */
              static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
              static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyUnicode_Substring */
              static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
            PyObject* text, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length;
    if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
    length = __Pyx_PyUnicode_GET_LENGTH(text);
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    length = stop - start;
    if (length <= 0)
        return PyUnicode_FromUnicode(NULL, 0);
#if CYTHON_PEP393_ENABLED
    return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
        PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
#else
    return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start);
#endif
}

/* PyIntBinop */
              #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* CallUnboundCMethod0 */
              static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_items */
              static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* GetAttr3 */
              static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* PyObject_GenericGetAttrNoDict */
              #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* ImportFrom */
              static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CLineInTraceback */
              #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
      use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (PyObject_Not(use_cline) != 0) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
              static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
              #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
              #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
              static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
              static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
              #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CoroutineBase */
              #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    if (self->exc_type) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
    if (likely(self->exc_traceback)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
                  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
                  #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
                  static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
                  static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
                  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
