/* Generated by Cython 0.28.5 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "name": "metaphor.chem_gm.core.graphmachineworkshop",
        "sources": [
            "metaphor/chem_gm/core/graphmachineworkshop.py"
        ]
    },
    "module_name": "metaphor.chem_gm.core.graphmachineworkshop"
}
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__chem_gm__core__graphmachineworkshop
#define __PYX_HAVE_API__metaphor__chem_gm__core__graphmachineworkshop
/* 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/chem_gm/core/graphmachineworkshop.py",
};

/*--- Type declarations ---*/
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults {
  PyObject *__pyx_arg_connect;
  PyObject *__pyx_arg_chargelist;
  PyObject *__pyx_arg_stickerlist;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_stickerlist;
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

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

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

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

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

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

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/* Module declarations from 'metaphor.chem_gm.core.graphmachineworkshop' */
#define __Pyx_MODULE_NAME "metaphor.chem_gm.core.graphmachineworkshop"
extern int __pyx_module_is_main_metaphor__chem_gm__core__graphmachineworkshop;
int __pyx_module_is_main_metaphor__chem_gm__core__graphmachineworkshop = 0;

/* Implementation of 'metaphor.chem_gm.core.graphmachineworkshop' */
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static const char __pyx_k_[] = "";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_H[] = "-H";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_H0[] = "H0";
static const char __pyx_k_H1[] = "H1";
static const char __pyx_k__2[] = ",";
static const char __pyx_k__7[] = "_";
static const char __pyx_k_cc[] = "cc";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_jj[] = "jj";
static const char __pyx_k_lc[] = "lc";
static const char __pyx_k_ll[] = "ll";
static const char __pyx_k_ni[] = "ni";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_st[] = "st";
static const char __pyx_k_Chi[] = "Chi";
static const char __pyx_k_Iso[] = "Iso";
static const char __pyx_k__19[] = "']=";
static const char __pyx_k__29[] = "*";
static const char __pyx_k__30[] = ", ";
static const char __pyx_k__32[] = "[";
static const char __pyx_k__33[] = "]";
static const char __pyx_k_del[] = "__del__";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_iso[] = "iso";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lin[] = "lin";
static const char __pyx_k_lst[] = "lst";
static const char __pyx_k_pm4[] = "pm4";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_qm1[] = "qm1";
static const char __pyx_k_qm2[] = "qm2";
static const char __pyx_k_qm3[] = "qm3";
static const char __pyx_k_qp1[] = "qp1";
static const char __pyx_k_qp2[] = "qp2";
static const char __pyx_k_qp3[] = "qp3";
static const char __pyx_k_qp4[] = "qp4";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_smi[] = "smi";
static const char __pyx_k_tok[] = "tok";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_TANH[] = "TANH";
static const char __pyx_k_Unit[] = "Unit";
static const char __pyx_k_atom[] = "atom";
static const char __pyx_k_bias[] = "bias";
static const char __pyx_k_file[] = "__file__";
static const char __pyx_k_iChi[] = "iChi";
static const char __pyx_k_iIso[] = "iIso";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_node[] = "node";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_smiC[] = "smiC";
static const char __pyx_k_smiN[] = "smiN";
static const char __pyx_k_smiO[] = "smiO";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tokt[] = "tokt";
static const char __pyx_k_afunc[] = "afunc";
static const char __pyx_k_atoms[] = "atoms";
static const char __pyx_k_bonds[] = "_bonds";
static const char __pyx_k_cumul[] = "cumul";
static const char __pyx_k_curID[] = "curID";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_grade[] = "grade";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_monal[] = "monal";
static const char __pyx_k_named[] = "named";
static const char __pyx_k_natom[] = "natom";
static const char __pyx_k_nodes[] = "nodes";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_saved[] = "saved";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_style[] = "style";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_token[] = "token";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Atomes[] = "Atomes";
static const char __pyx_k_PS_END[] = "PS_END";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_byname[] = "byname";
static const char __pyx_k_charge[] = "charge";
static const char __pyx_k_chikey[] = "chikey";
static const char __pyx_k_chiral[] = "chiral";
static const char __pyx_k_coniso[] = "coniso";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_fixed1[] = "fixed1";
static const char __pyx_k_hidden[] = "hidden";
static const char __pyx_k_iDegre[] = "iDegre";
static const char __pyx_k_ilayer[] = "ilayer";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_inlist[] = "inlist";
static const char __pyx_k_inputs[] = "inputs";
static const char __pyx_k_isokey[] = "isokey";
static const char __pyx_k_isomax[] = "isomax";
static const char __pyx_k_isomer[] = "isomer";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_nlayer[] = "nlayer";
static const char __pyx_k_numero[] = "numero";
static const char __pyx_k_params[] = "params";
static const char __pyx_k_reseau[] = "reseau";
static const char __pyx_k_suffix[] = "suffix";
static const char __pyx_k_symbol[] = "symbol";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_tokill[] = "tokill";
static const char __pyx_k_LS_FIXE[] = "LS_FIXE";
static const char __pyx_k_SIGMOID[] = "SIGMOID";
static const char __pyx_k_addLink[] = "addLink";
static const char __pyx_k_classif[] = "classif";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_cuthead[] = "cuthead";
static const char __pyx_k_ebauche[] = "_ebauche";
static const char __pyx_k_factory[] = "factory";
static const char __pyx_k_gmutils[] = "gmutils";
static const char __pyx_k_keepend[] = "keepend";
static const char __pyx_k_monalPy[] = "(monalPy)";
static const char __pyx_k_nameloc[] = "nameloc";
static const char __pyx_k_nbroken[] = "nbroken";
static const char __pyx_k_outfunc[] = "outfunc";
static const char __pyx_k_outputs[] = "outputs";
static const char __pyx_k_parents[] = "parents";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_SmiError[] = "SmiError";
static const char __pyx_k_SmiToken[] = "SmiToken";
static const char __pyx_k_StringIO[] = "StringIO";
static const char __pyx_k_actionC1[] = "actionC1";
static const char __pyx_k_addLayer[] = "addLayer";
static const char __pyx_k_alphagen[] = "alphagen";
static const char __pyx_k_curmodel[] = "curmodel";
static const char __pyx_k_gradekey[] = "gradekey";
static const char __pyx_k_grademax[] = "grademax";
static const char __pyx_k_isLinear[] = "isLinear";
static const char __pyx_k_maxgrade[] = "maxgrade";
static const char __pyx_k_moveNode[] = "moveNode";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_toktable[] = "toktable";
static const char __pyx_k_withBias[] = "withBias";
static const char __pyx_k_GMWorshop[] = "GMWorshop";
static const char __pyx_k_LayerData[] = "LayerData";
static const char __pyx_k_activfunc[] = "activfunc";
static const char __pyx_k_addLayers[] = "addLayers";
static const char __pyx_k_chargekey[] = "chargekey";
static const char __pyx_k_chirality[] = "chirality";
static const char __pyx_k_chiralmax[] = "chiralmax";
static const char __pyx_k_connect_2[] = "connect['";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_firstnode[] = "firstnode";
static const char __pyx_k_keepend_d[] = "keepend=%d";
static const char __pyx_k_lastlayer[] = "lastlayer";
static const char __pyx_k_layerlist[] = "layerlist";
static const char __pyx_k_layerstep[] = "layerstep";
static const char __pyx_k_mainModel[] = "mainModel";
static const char __pyx_k_mergeNode[] = "mergeNode";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_modelName[] = "modelName";
static const char __pyx_k_modelname[] = "modelname";
static const char __pyx_k_nodeNames[] = "nodeNames";
static const char __pyx_k_nodeindex[] = "nodeindex";
static const char __pyx_k_nosynapse[] = "nosynapse";
static const char __pyx_k_pertinent[] = "pertinent";
static const char __pyx_k_saveModel[] = "saveModel";
static const char __pyx_k_smitokens[] = "smitokens";
static const char __pyx_k_Cmodel_nml[] = "Cmodel.nml";
static const char __pyx_k_LS_TELQUEL[] = "LS_TELQUEL";
static const char __pyx_k_Nmodel_nml[] = "Nmodel.nml";
static const char __pyx_k_Omodel_nml[] = "Omodel.nml";
static const char __pyx_k_addComment[] = "addComment";
static const char __pyx_k_chargelist[] = "chargelist";
static const char __pyx_k_connectdef[] = "connectdef";
static const char __pyx_k_connexions[] = "connexions";
static const char __pyx_k_createLink[] = "createLink";
static const char __pyx_k_deleteLink[] = "deleteLink";
static const char __pyx_k_deleteNode[] = "deleteNode";
static const char __pyx_k_firstlayer[] = "firstlayer";
static const char __pyx_k_inputCount[] = "inputCount";
static const char __pyx_k_inputNames[] = "inputNames";
static const char __pyx_k_layerCount[] = "layerCount";
static const char __pyx_k_layerindex[] = "layerindex";
static const char __pyx_k_layershift[] = "layershift";
static const char __pyx_k_ma_proprit[] = "ma propri\303\251t\303\251";
static const char __pyx_k_mergeModel[] = "mergeModel";
static const char __pyx_k_monalconst[] = "monalconst";
static const char __pyx_k_nomFichier[] = "nomFichier";
static const char __pyx_k_outputbool[] = "outputbool";
static const char __pyx_k_outputname[] = "outputname";
static const char __pyx_k_richsymbol[] = "richsymbol";
static const char __pyx_k_CNmodel_nml[] = "CNmodel.nml";
static const char __pyx_k_H1layerdata[] = "H1layerdata";
static const char __pyx_k_H2layerdata[] = "H2layerdata";
static const char __pyx_k_INPUT_COUNT[] = "INPUT_COUNT";
static const char __pyx_k_LAYER_COUNT[] = "LAYER_COUNT";
static const char __pyx_k_addtokenrow[] = "addtokenrow";
static const char __pyx_k_compactness[] = "compactness";
static const char __pyx_k_deleteLayer[] = "deleteLayer";
static const char __pyx_k_ebauche_nml[] = "ebauche.nml";
static const char __pyx_k_finishmodel[] = "finishmodel";
static const char __pyx_k_hiddenindex[] = "hiddenindex";
static const char __pyx_k_impertinent[] = "impertinent";
static const char __pyx_k_layerLength[] = "layerLength";
static const char __pyx_k_mergeisochi[] = "mergeisochi";
static const char __pyx_k_ninputmerge[] = "ninputmerge";
static const char __pyx_k_nlayershift[] = "nlayershift";
static const char __pyx_k_nomFichierC[] = "nomFichierC";
static const char __pyx_k_nomFichierN[] = "nomFichierN";
static const char __pyx_k_nomFichierO[] = "nomFichierO";
static const char __pyx_k_originindex[] = "originindex";
static const char __pyx_k_originlayer[] = "originlayer";
static const char __pyx_k_outputNames[] = "outputNames";
static const char __pyx_k_singlelayer[] = "singlelayer";
static const char __pyx_k_stickerlist[] = "stickerlist";
static const char __pyx_k_targetindex[] = "targetindex";
static const char __pyx_k_targetlayer[] = "targetlayer";
static const char __pyx_k_CNOmodel_nml[] = "CNOmodel.nml";
static const char __pyx_k_GMModelError[] = "GMModelError";
static const char __pyx_k_compactModel[] = "compactModel";
static const char __pyx_k_connectLayer[] = "connectLayer";
static const char __pyx_k_hiddenatom_d[] = "hiddenatom=%d";
static const char __pyx_k_isolateInput[] = "isolateInput";
static const char __pyx_k_monal_driver[] = "monal.driver";
static const char __pyx_k_nomFichierCN[] = "nomFichierCN";
static const char __pyx_k_setNodeValue[] = "setNodeValue";
static const char __pyx_k_synapseAlign[] = "synapseAlign";
static const char __pyx_k_CM_PARAMETERS[] = "CM_PARAMETERS";
static const char __pyx_k_PS_KEEP_LINKS[] = "PS_KEEP_LINKS";
static const char __pyx_k_modelWorkshop[] = "modelWorkshop";
static const char __pyx_k_nomFichierCNO[] = "nomFichierCNO";
static const char __pyx_k_removeorphans[] = "removeorphans";
static const char __pyx_k_NetworkFactory[] = "NetworkFactory";
static const char __pyx_k_sharedsynapses[] = "sharedsynapses";
static const char __pyx_k_extraInputCount[] = "_extraInputCount";
static const char __pyx_k_setOutputParams[] = "setOutputParams";
static const char __pyx_k_GMWorshop___init[] = "GMWorshop.__init__";
static const char __pyx_k_II_P_SYN_PARENTS[] = "II_P_SYN_PARENTS";
static const char __pyx_k_defaultnodevalue[] = "defaultnodevalue";
static const char __pyx_k_modelbrkexcluded[] = "modelbrkexcluded";
static const char __pyx_k_modelbrokencount[] = "modelbrokencount";
static const char __pyx_k_II_P_LAYER_LENGTH[] = "II_P_LAYER_LENGTH";
static const char __pyx_k_II_P_SYN_CHILDREN[] = "II_P_SYN_CHILDREN";
static const char __pyx_k_six_moves_cPickle[] = "six.moves.cPickle";
static const char __pyx_k_specialisermodele[] = "_specialisermodele";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_monal_monalrecords[] = "monal.monalrecords";
static const char __pyx_k_symbolFromNodeName[] = "symbolFromNodeName";
static const char __pyx_k_linear_single_layer[] = "linear single layer";
static const char __pyx_k_Elementary_Graph_Net[] = "Elementary_Graph_Net";
static const char __pyx_k_GMWorshop_addtokenrow[] = "GMWorshop.addtokenrow";
static const char __pyx_k_GMWorshop_finishmodel[] = "GMWorshop.finishmodel";
static const char __pyx_k_GMWorshop_removeorphans[] = "GMWorshop.removeorphans";
static const char __pyx_k_Error_in_model_merging_s[] = "Error in model merging = %s";
static const char __pyx_k_Mon_modele_Graph_Machine[] = "Mon modele Graph Machine";
static const char __pyx_k_monal_util_modelworkshop[] = "monal.util.modelworkshop";
static const char __pyx_k_GMWorshop__specialisermodele[] = "GMWorshop._specialisermodele";
static const char __pyx_k_Htitage_de_monal_modelworkshop[] = "\n    H\303\251titage de monal.modelworkshop.modelWorkshop, sp\303\251cialis\303\251 pour les graph machines\n    L'initialisation permet de cr\303\251er le mod\303\250le atomique \303\251bauche, qui est enregistr\303\251 dans l'instance\n    sous forme d'une cha\303\256ne de caract\303\250res.\n    Le mod\303\250le d\303\251finitif est ensuite mis en forme par absorptikon succesive des couches de jetons SmiToken.\n    Param\303\250tres d'initialisation:\n        atoms -> Entier ou liste des symboles d'atomes utilis\303\251s dans le mod\303\250le.\n            Si atomes est un entier, il repr\303\251sente le nombre des premiers atomes pris dans la liste \n            Atomes du module GMutils\n        hidden -> Entier. nombre des noeuds cach\303\251s du mod\303\250le \303\251bauche.\n        maxgrade -> Entier. Niveau maximum des degr\303\251s des atomes \n        isomer -> Bool\303\251en. Pr\303\251sence d'information d'isom\303\251rie;\n        chirality -> Bool\303\251en. Pr\303\251sence de chiralit\303\251. \n        connect -> Dictionnaire des connectivit\303\251s. La valeur -1 donne une connectivit\303\251 totale (=hidden)\n        connexiongradeiso -> Liste; Liste des connectivit\303\251s des entr\303\251es de degr\303\251s et d'isom\303\251rie.\n        classif -> Boolean. indique une sortie avec fonction sigmo\303\257de.\n        actionC1 -> action for the C atom of order 1 :\n            0 : aucune liaison\n            1 : liaison fixe 1\n            2 : liaison normale\n        \n    M\303\251thode expos\303\251es :\n        addtokenrow(self, lst) : Int\303\251gration d'une nouvelle liste de jetons.\n        finishmodel(self, keepend=0)      : Finition du mod\303\250le par int\303\251gration des entr\303\251es. \n            \"keepend\"   -> nombre d'entr\303\251es d'\303\251tiquettes \303\240 conserver. D\303\251faut 0\n        ";
static const char __pyx_k_constant_inputs_integrated_in_bi[] = "constant inputs integrated in bias";
static const char __pyx_k_constant_inputs_integrated_in_co[] = "constant inputs integrated in constant layer";
static const char __pyx_k_constant_inputs_integrated_in_la[] = "constant inputs integrated in layer 1";
static const char __pyx_k_exceeding_iso_and_chiral_value_s[] = "exceeding iso and chiral value\"%s\"";
static const char __pyx_k_metaphor_chem_gm_core_graphmachi[] = "metaphor.chem_gm.core.graphmachineworkshop";
static const char __pyx_k_python_generated_for_graph_machi[] = "python generated for graph machine %s";
static const char __pyx_k_metaphor_chem_gm_core_graphmachi_2[] = "metaphor/chem_gm/core/graphmachineworkshop.py";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_Atomes;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_n_u_C;
static PyObject *__pyx_n_s_CM_PARAMETERS;
static PyObject *__pyx_kp_u_CNOmodel_nml;
static PyObject *__pyx_kp_u_CNmodel_nml;
static PyObject *__pyx_n_u_Chi;
static PyObject *__pyx_kp_u_Cmodel_nml;
static PyObject *__pyx_n_u_D;
static PyObject *__pyx_n_u_Elementary_Graph_Net;
static PyObject *__pyx_kp_u_Error_in_model_merging_s;
static PyObject *__pyx_n_s_GMModelError;
static PyObject *__pyx_n_s_iso885915_GMModelError;
static PyObject *__pyx_n_s_GMWorshop;
static PyObject *__pyx_n_s_iso885915_GMWorshop;
static PyObject *__pyx_n_s_GMWorshop___init;
static PyObject *__pyx_n_s_GMWorshop__specialisermodele;
static PyObject *__pyx_n_s_GMWorshop_addtokenrow;
static PyObject *__pyx_n_s_GMWorshop_finishmodel;
static PyObject *__pyx_n_s_GMWorshop_removeorphans;
static PyObject *__pyx_kp_u_H;
static PyObject *__pyx_n_u_H0;
static PyObject *__pyx_n_u_H1;
static PyObject *__pyx_n_s_H1layerdata;
static PyObject *__pyx_n_s_H2layerdata;
static PyObject *__pyx_kp_s_Htitage_de_monal_modelworkshop;
static PyObject *__pyx_n_s_II_P_LAYER_LENGTH;
static PyObject *__pyx_n_s_II_P_SYN_CHILDREN;
static PyObject *__pyx_n_s_II_P_SYN_PARENTS;
static PyObject *__pyx_n_s_INPUT_COUNT;
static PyObject *__pyx_n_u_Iso;
static PyObject *__pyx_n_s_LAYER_COUNT;
static PyObject *__pyx_n_s_LS_FIXE;
static PyObject *__pyx_n_s_LS_TELQUEL;
static PyObject *__pyx_n_s_LayerData;
static PyObject *__pyx_kp_u_Mon_modele_Graph_Machine;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_n_u_N;
static PyObject *__pyx_n_s_NetworkFactory;
static PyObject *__pyx_kp_u_Nmodel_nml;
static PyObject *__pyx_n_u_O;
static PyObject *__pyx_kp_u_Omodel_nml;
static PyObject *__pyx_n_s_PS_END;
static PyObject *__pyx_n_s_PS_KEEP_LINKS;
static PyObject *__pyx_n_u_SIGMOID;
static PyObject *__pyx_n_s_SmiError;
static PyObject *__pyx_n_s_SmiToken;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_n_u_TANH;
static PyObject *__pyx_n_u_Unit;
static PyObject *__pyx_kp_u__19;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__29;
static PyObject *__pyx_kp_u__30;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_n_u__7;
static PyObject *__pyx_n_s_actionC1;
static PyObject *__pyx_n_s_activfunc;
static PyObject *__pyx_n_s_addComment;
static PyObject *__pyx_n_s_addLayer;
static PyObject *__pyx_n_s_addLayers;
static PyObject *__pyx_n_s_addLink;
static PyObject *__pyx_n_s_addtokenrow;
static PyObject *__pyx_n_s_afunc;
static PyObject *__pyx_n_s_alphagen;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_atom;
static PyObject *__pyx_n_s_atoms;
static PyObject *__pyx_n_s_bias;
static PyObject *__pyx_n_s_bonds;
static PyObject *__pyx_n_s_byname;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_cc;
static PyObject *__pyx_n_s_charge;
static PyObject *__pyx_n_s_chargekey;
static PyObject *__pyx_n_s_chargelist;
static PyObject *__pyx_n_s_chikey;
static PyObject *__pyx_n_s_chiral;
static PyObject *__pyx_n_s_chirality;
static PyObject *__pyx_n_s_chiralmax;
static PyObject *__pyx_n_s_classif;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_compactModel;
static PyObject *__pyx_n_s_compactness;
static PyObject *__pyx_n_s_coniso;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_connectLayer;
static PyObject *__pyx_kp_u_connect_2;
static PyObject *__pyx_n_s_connectdef;
static PyObject *__pyx_n_s_connexions;
static PyObject *__pyx_kp_u_constant_inputs_integrated_in_bi;
static PyObject *__pyx_kp_u_constant_inputs_integrated_in_co;
static PyObject *__pyx_kp_u_constant_inputs_integrated_in_la;
static PyObject *__pyx_n_s_createLink;
static PyObject *__pyx_n_s_cumul;
static PyObject *__pyx_n_s_curID;
static PyObject *__pyx_n_s_curmodel;
static PyObject *__pyx_n_s_cuthead;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_defaultnodevalue;
static PyObject *__pyx_n_s_del;
static PyObject *__pyx_n_s_deleteLayer;
static PyObject *__pyx_n_s_deleteLink;
static PyObject *__pyx_n_s_deleteNode;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_driver;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_ebauche;
static PyObject *__pyx_kp_u_ebauche_nml;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_kp_u_exceeding_iso_and_chiral_value_s;
static PyObject *__pyx_n_s_extraInputCount;
static PyObject *__pyx_n_s_factory;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_finishmodel;
static PyObject *__pyx_n_s_firstlayer;
static PyObject *__pyx_n_s_firstnode;
static PyObject *__pyx_n_s_fixed1;
static PyObject *__pyx_n_s_gmutils;
static PyObject *__pyx_n_s_grade;
static PyObject *__pyx_n_s_gradekey;
static PyObject *__pyx_n_s_grademax;
static PyObject *__pyx_n_s_hidden;
static PyObject *__pyx_kp_u_hiddenatom_d;
static PyObject *__pyx_n_s_hiddenindex;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_iChi;
static PyObject *__pyx_n_s_iDegre;
static PyObject *__pyx_n_s_iIso;
static PyObject *__pyx_n_s_ilayer;
static PyObject *__pyx_n_s_impertinent;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_inlist;
static PyObject *__pyx_n_s_inputCount;
static PyObject *__pyx_n_s_inputNames;
static PyObject *__pyx_n_s_inputs;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_isLinear;
static PyObject *__pyx_n_s_iso;
static PyObject *__pyx_n_s_isokey;
static PyObject *__pyx_n_s_isolateInput;
static PyObject *__pyx_n_s_isomax;
static PyObject *__pyx_n_s_isomer;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_jj;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keepend;
static PyObject *__pyx_kp_u_keepend_d;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_lastlayer;
static PyObject *__pyx_n_s_layerCount;
static PyObject *__pyx_n_s_layerLength;
static PyObject *__pyx_n_s_layerindex;
static PyObject *__pyx_n_s_layerlist;
static PyObject *__pyx_n_s_layershift;
static PyObject *__pyx_n_s_layerstep;
static PyObject *__pyx_n_s_lc;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_lin;
static PyObject *__pyx_kp_u_linear_single_layer;
static PyObject *__pyx_n_s_ll;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lst;
static PyObject *__pyx_kp_u_ma_proprit;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_u_main;
static PyObject *__pyx_n_s_mainModel;
static PyObject *__pyx_n_s_maxgrade;
static PyObject *__pyx_n_s_mergeModel;
static PyObject *__pyx_n_s_mergeNode;
static PyObject *__pyx_n_s_mergeisochi;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metaphor_chem_gm_core_graphmachi;
static PyObject *__pyx_kp_s_metaphor_chem_gm_core_graphmachi_2;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_modelName;
static PyObject *__pyx_n_s_modelWorkshop;
static PyObject *__pyx_n_s_modelbrkexcluded;
static PyObject *__pyx_n_s_modelbrokencount;
static PyObject *__pyx_n_s_modelname;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_monal;
static PyObject *__pyx_kp_u_monalPy;
static PyObject *__pyx_n_s_monal_driver;
static PyObject *__pyx_n_s_monal_monalrecords;
static PyObject *__pyx_n_s_monal_util_modelworkshop;
static PyObject *__pyx_n_s_monalconst;
static PyObject *__pyx_n_s_moveNode;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_named;
static PyObject *__pyx_n_s_nameloc;
static PyObject *__pyx_n_s_natom;
static PyObject *__pyx_n_s_nbroken;
static PyObject *__pyx_n_s_ni;
static PyObject *__pyx_n_s_ninputmerge;
static PyObject *__pyx_n_s_nlayer;
static PyObject *__pyx_n_s_nlayershift;
static PyObject *__pyx_n_s_node;
static PyObject *__pyx_n_s_nodeNames;
static PyObject *__pyx_n_s_nodeindex;
static PyObject *__pyx_n_s_nodes;
static PyObject *__pyx_n_s_nomFichier;
static PyObject *__pyx_n_s_nomFichierC;
static PyObject *__pyx_n_s_nomFichierCN;
static PyObject *__pyx_n_s_nomFichierCNO;
static PyObject *__pyx_n_s_nomFichierN;
static PyObject *__pyx_n_s_nomFichierO;
static PyObject *__pyx_n_s_nosynapse;
static PyObject *__pyx_n_s_numero;
static PyObject *__pyx_n_s_order;
static PyObject *__pyx_n_s_originindex;
static PyObject *__pyx_n_s_originlayer;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_outfunc;
static PyObject *__pyx_n_s_outputNames;
static PyObject *__pyx_n_s_outputbool;
static PyObject *__pyx_n_s_outputname;
static PyObject *__pyx_n_s_outputs;
static PyObject *__pyx_n_s_params;
static PyObject *__pyx_n_s_parents;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pertinent;
static PyObject *__pyx_n_u_pm4;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_u_property;
static PyObject *__pyx_kp_u_python_generated_for_graph_machi;
static PyObject *__pyx_n_u_qm1;
static PyObject *__pyx_n_u_qm2;
static PyObject *__pyx_n_u_qm3;
static PyObject *__pyx_n_u_qp1;
static PyObject *__pyx_n_u_qp2;
static PyObject *__pyx_n_u_qp3;
static PyObject *__pyx_n_u_qp4;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_removeorphans;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_reseau;
static PyObject *__pyx_n_s_richsymbol;
static PyObject *__pyx_n_s_saveModel;
static PyObject *__pyx_n_u_saved;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_setNodeValue;
static PyObject *__pyx_n_s_setOutputParams;
static PyObject *__pyx_n_s_sharedsynapses;
static PyObject *__pyx_n_s_singlelayer;
static PyObject *__pyx_n_s_six_moves_cPickle;
static PyObject *__pyx_n_s_smi;
static PyObject *__pyx_n_s_smiC;
static PyObject *__pyx_n_s_smiN;
static PyObject *__pyx_n_s_smiO;
static PyObject *__pyx_n_s_smitokens;
static PyObject *__pyx_n_s_specialisermodele;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_st;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stickerlist;
static PyObject *__pyx_n_s_style;
static PyObject *__pyx_n_s_suffix;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_symbol;
static PyObject *__pyx_n_s_symbolFromNodeName;
static PyObject *__pyx_n_s_synapseAlign;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_targetindex;
static PyObject *__pyx_n_s_targetlayer;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tok;
static PyObject *__pyx_n_s_token;
static PyObject *__pyx_n_s_tokill;
static PyObject *__pyx_n_s_tokt;
static PyObject *__pyx_n_s_toktable;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_withBias;
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop___defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_hidden, PyObject *__pyx_v_maxgrade, PyObject *__pyx_v_isomer, PyObject *__pyx_v_chirality, PyObject *__pyx_v_connect, PyObject *__pyx_v_classif, PyObject *__pyx_v_chargelist, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_outputname, PyObject *__pyx_v_modelname, CYTHON_UNUSED PyObject *__pyx_v_defaultnodevalue); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_2finishmodel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keepend, PyObject *__pyx_v_compactness, CYTHON_UNUSED PyObject *__pyx_v_params); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_4addtokenrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lst, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_mergeisochi); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_6removeorphans(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_8_specialisermodele(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_token, PyObject *__pyx_v_lin, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_mergeisochi); /* proto */
static PyObject *__pyx_float_0_0;
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_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_slice__4;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__34;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__46;
/* Late includes */

/* "metaphor/chem_gm/core/graphmachineworkshop.py":83
 *         """
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,             # <<<<<<<<<<<<<<
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop___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);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":84
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],             # <<<<<<<<<<<<<<
 *             stickerlist=[], outputname="property", modelname="",
 *             defaultnodevalue=0.0):  # GMWorshop
 */
  __pyx_t_1 = PyTuple_New(12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_3));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_3));
  __Pyx_INCREF(((PyObject *)__pyx_int_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_3));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_3));
  __Pyx_INCREF(((PyObject *)__pyx_int_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_1));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_1));
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_0));
  __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_connect);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_connect);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_connect);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_chargelist);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_chargelist);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_chargelist);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_stickerlist);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_stickerlist);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_stickerlist);
  __Pyx_INCREF(((PyObject*)__pyx_n_u_property));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_property));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject*)__pyx_n_u_property));
  __Pyx_INCREF(((PyObject*)__pyx_kp_u_));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_u_));
  PyTuple_SET_ITEM(__pyx_t_1, 10, ((PyObject*)__pyx_kp_u_));
  __Pyx_INCREF(((PyObject*)__pyx_float_0_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_float_0_0));
  PyTuple_SET_ITEM(__pyx_t_1, 11, ((PyObject*)__pyx_float_0_0));

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":83
 *         """
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,             # <<<<<<<<<<<<<<
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __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.chem_gm.core.graphmachineworkshop.__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_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_atoms = 0;
  PyObject *__pyx_v_hidden = 0;
  PyObject *__pyx_v_maxgrade = 0;
  PyObject *__pyx_v_isomer = 0;
  PyObject *__pyx_v_chirality = 0;
  PyObject *__pyx_v_connect = 0;
  PyObject *__pyx_v_classif = 0;
  PyObject *__pyx_v_chargelist = 0;
  PyObject *__pyx_v_stickerlist = 0;
  PyObject *__pyx_v_outputname = 0;
  PyObject *__pyx_v_modelname = 0;
  CYTHON_UNUSED PyObject *__pyx_v_defaultnodevalue = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_atoms,&__pyx_n_s_hidden,&__pyx_n_s_maxgrade,&__pyx_n_s_isomer,&__pyx_n_s_chirality,&__pyx_n_s_connect,&__pyx_n_s_classif,&__pyx_n_s_chargelist,&__pyx_n_s_stickerlist,&__pyx_n_s_outputname,&__pyx_n_s_modelname,&__pyx_n_s_defaultnodevalue,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)__pyx_int_3));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_3));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_1));
    values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[6] = __pyx_dynamic_args->__pyx_arg_connect;
    values[7] = ((PyObject *)((PyObject *)Py_None));
    values[8] = __pyx_dynamic_args->__pyx_arg_chargelist;
    values[9] = __pyx_dynamic_args->__pyx_arg_stickerlist;
    values[10] = ((PyObject *)((PyObject*)__pyx_n_u_property));
    values[11] = ((PyObject *)((PyObject*)__pyx_kp_u_));
    values[12] = ((PyObject *)((PyObject*)__pyx_float_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 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        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_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_atoms);
          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_hidden);
          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_maxgrade);
          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_isomer);
          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_chirality);
          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_connect);
          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_classif);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chargelist);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stickerlist);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outputname);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_modelname);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaultnodevalue);
          if (value) { values[12] = 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, 83, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_atoms = values[1];
    __pyx_v_hidden = values[2];
    __pyx_v_maxgrade = values[3];
    __pyx_v_isomer = values[4];
    __pyx_v_chirality = values[5];
    __pyx_v_connect = values[6];
    __pyx_v_classif = values[7];
    __pyx_v_chargelist = values[8];
    __pyx_v_stickerlist = values[9];
    __pyx_v_outputname = values[10];
    __pyx_v_modelname = values[11];
    __pyx_v_defaultnodevalue = values[12];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 83, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop___init__(__pyx_self, __pyx_v_self, __pyx_v_atoms, __pyx_v_hidden, __pyx_v_maxgrade, __pyx_v_isomer, __pyx_v_chirality, __pyx_v_connect, __pyx_v_classif, __pyx_v_chargelist, __pyx_v_stickerlist, __pyx_v_outputname, __pyx_v_modelname, __pyx_v_defaultnodevalue);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_hidden, PyObject *__pyx_v_maxgrade, PyObject *__pyx_v_isomer, PyObject *__pyx_v_chirality, PyObject *__pyx_v_connect, PyObject *__pyx_v_classif, PyObject *__pyx_v_chargelist, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_outputname, PyObject *__pyx_v_modelname, CYTHON_UNUSED PyObject *__pyx_v_defaultnodevalue) {
  PyObject *__pyx_v_actionC1 = NULL;
  PyObject *__pyx_v_afunc = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_atom = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_inlist = NULL;
  PyObject *__pyx_v_H1layerdata = NULL;
  PyObject *__pyx_v_H2layerdata = NULL;
  PyObject *__pyx_v_layerlist = NULL;
  PyObject *__pyx_v_outfunc = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_curID = NULL;
  PyObject *__pyx_v_cc = NULL;
  PyObject *__pyx_v_targetindex = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_iIso = NULL;
  PyObject *__pyx_v_iChi = NULL;
  PyObject *__pyx_v_iDegre = NULL;
  PyObject *__pyx_v_nameloc = NULL;
  PyObject *__pyx_7genexpr__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_index = 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;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  long __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *(*__pyx_t_21)(PyObject *);
  Py_ssize_t __pyx_t_22;
  Py_UCS4 __pyx_t_23;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_atoms);
  __Pyx_INCREF(__pyx_v_maxgrade);
  __Pyx_INCREF(__pyx_v_isomer);
  __Pyx_INCREF(__pyx_v_chirality);
  __Pyx_INCREF(__pyx_v_chargelist);
  __Pyx_INCREF(__pyx_v_stickerlist);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":88
 *             defaultnodevalue=0.0):  # GMWorshop
 * 
 *         super(GMWorshop, self).__init__()             # <<<<<<<<<<<<<<
 * 
 *         maxgrade = int(maxgrade)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_GMWorshop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __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, 88, __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, 88, __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, 88, __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, 88, __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/chem_gm/core/graphmachineworkshop.py":90
 *         super(GMWorshop, self).__init__()
 * 
 *         maxgrade = int(maxgrade)             # <<<<<<<<<<<<<<
 *         isomer = int(isomer)
 *         chirality = int(chirality)
 */
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_maxgrade); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_maxgrade, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":91
 * 
 *         maxgrade = int(maxgrade)
 *         isomer = int(isomer)             # <<<<<<<<<<<<<<
 *         chirality = int(chirality)
 *         actionC1 = int(bool(hidden))  # not le 08/02/2019
 */
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_isomer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_isomer, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":92
 *         maxgrade = int(maxgrade)
 *         isomer = int(isomer)
 *         chirality = int(chirality)             # <<<<<<<<<<<<<<
 *         actionC1 = int(bool(hidden))  # not le 08/02/2019
 *         self.toktable = []  # liste des jetons dj intgrs
 */
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_chirality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_chirality, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":93
 *         isomer = int(isomer)
 *         chirality = int(chirality)
 *         actionC1 = int(bool(hidden))  # not le 08/02/2019             # <<<<<<<<<<<<<<
 *         self.toktable = []  # liste des jetons dj intgrs
 *         self.grademax = maxgrade  # degre maximum
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_hidden); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 93, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_actionC1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":94
 *         chirality = int(chirality)
 *         actionC1 = int(bool(hidden))  # not le 08/02/2019
 *         self.toktable = []  # liste des jetons dj intgrs             # <<<<<<<<<<<<<<
 *         self.grademax = maxgrade  # degre maximum
 *         self.isomax = 0 if not isomer else 3 # dimension des entres d'isomrie
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_toktable, __pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":95
 *         actionC1 = int(bool(hidden))  # not le 08/02/2019
 *         self.toktable = []  # liste des jetons dj intgrs
 *         self.grademax = maxgrade  # degre maximum             # <<<<<<<<<<<<<<
 *         self.isomax = 0 if not isomer else 3 # dimension des entres d'isomrie
 *         self.chiralmax = 0 if not chirality else 3 # dimension des entres de chiralit
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_grademax, __pyx_v_maxgrade) < 0) __PYX_ERR(0, 95, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":96
 *         self.toktable = []  # liste des jetons dj intgrs
 *         self.grademax = maxgrade  # degre maximum
 *         self.isomax = 0 if not isomer else 3 # dimension des entres d'isomrie             # <<<<<<<<<<<<<<
 *         self.chiralmax = 0 if not chirality else 3 # dimension des entres de chiralit
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_isomer); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
  if (((!__pyx_t_4) != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
  } else {
    __Pyx_INCREF(__pyx_int_3);
    __pyx_t_3 = __pyx_int_3;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_isomax, __pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":97
 *         self.grademax = maxgrade  # degre maximum
 *         self.isomax = 0 if not isomer else 3 # dimension des entres d'isomrie
 *         self.chiralmax = 0 if not chirality else 3 # dimension des entres de chiralit             # <<<<<<<<<<<<<<
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche
 *         self.singlelayer =  hidden < 1
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_chirality); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
  if (((!__pyx_t_4) != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
  } else {
    __Pyx_INCREF(__pyx_int_3);
    __pyx_t_3 = __pyx_int_3;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_chiralmax, __pyx_t_3) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":98
 *         self.isomax = 0 if not isomer else 3 # dimension des entres d'isomrie
 *         self.chiralmax = 0 if not chirality else 3 # dimension des entres de chiralit
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche             # <<<<<<<<<<<<<<
 *         self.singlelayer =  hidden < 1
 *         if self.singlelayer:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hidden, __pyx_v_hidden) < 0) __PYX_ERR(0, 98, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":99
 *         self.chiralmax = 0 if not chirality else 3 # dimension des entres de chiralit
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche
 *         self.singlelayer =  hidden < 1             # <<<<<<<<<<<<<<
 *         if self.singlelayer:
 *             self.hidden = 1
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_hidden, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":100
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche
 *         self.singlelayer =  hidden < 1
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             self.hidden = 1
 *             afunc = ''
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":101
 *         self.singlelayer =  hidden < 1
 *         if self.singlelayer:
 *             self.hidden = 1             # <<<<<<<<<<<<<<
 *             afunc = ''
 *         else:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hidden, __pyx_int_1) < 0) __PYX_ERR(0, 101, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":102
 *         if self.singlelayer:
 *             self.hidden = 1
 *             afunc = ''             # <<<<<<<<<<<<<<
 *         else:
 *             afunc = 'TANH'
 */
    __Pyx_INCREF(__pyx_kp_u_);
    __pyx_v_afunc = __pyx_kp_u_;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":100
 *         self.hidden = hidden # nombre de neurones cachs du modle bauche
 *         self.singlelayer =  hidden < 1
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             self.hidden = 1
 *             afunc = ''
 */
    goto __pyx_L3;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":104
 *             afunc = ''
 *         else:
 *             afunc = 'TANH'             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(atoms, int):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_n_u_TANH);
    __pyx_v_afunc = __pyx_n_u_TANH;
  }
  __pyx_L3:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":106
 *             afunc = 'TANH'
 * 
 *         if isinstance(atoms, int):             # <<<<<<<<<<<<<<
 *         #si atoms est un entier, on va chercher les premiers atomes de la liste par dfaut dans utils
 *             atoms = [Atomes[i] for i in range(atoms)]
 */
  __pyx_t_4 = PyInt_Check(__pyx_v_atoms); 
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":108
 *         if isinstance(atoms, int):
 *         #si atoms est un entier, on va chercher les premiers atomes de la liste par dfaut dans utils
 *             atoms = [Atomes[i] for i in range(atoms)]             # <<<<<<<<<<<<<<
 *         elif isinstance(atoms, str):
 *             atoms = atoms.split(',')
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_atoms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L7_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_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, 108, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L7_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, 108, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L7_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, 108, __pyx_L7_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L7_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, 108, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Atomes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 108, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 108, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_atoms, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":106
 *             afunc = 'TANH'
 * 
 *         if isinstance(atoms, int):             # <<<<<<<<<<<<<<
 *         #si atoms est un entier, on va chercher les premiers atomes de la liste par dfaut dans utils
 *             atoms = [Atomes[i] for i in range(atoms)]
 */
    goto __pyx_L4;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":109
 *         #si atoms est un entier, on va chercher les premiers atomes de la liste par dfaut dans utils
 *             atoms = [Atomes[i] for i in range(atoms)]
 *         elif isinstance(atoms, str):             # <<<<<<<<<<<<<<
 *             atoms = atoms.split(',')
 * 
 */
  __pyx_t_5 = PyUnicode_Check(__pyx_v_atoms); 
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":110
 *             atoms = [Atomes[i] for i in range(atoms)]
 *         elif isinstance(atoms, str):
 *             atoms = atoms.split(',')             # <<<<<<<<<<<<<<
 * 
 *         #ajustement des connectivites. Si la valeur est -1, on la met a self.hidden
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_atoms, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":109
 *         #si atoms est un entier, on va chercher les premiers atomes de la liste par dfaut dans utils
 *             atoms = [Atomes[i] for i in range(atoms)]
 *         elif isinstance(atoms, str):             # <<<<<<<<<<<<<<
 *             atoms = atoms.split(',')
 * 
 */
  }
  __pyx_L4:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":113
 * 
 *         #ajustement des connectivites. Si la valeur est -1, on la met a self.hidden
 *         for key in connect.keys():             # <<<<<<<<<<<<<<
 *             if connect[key] == -1:
 *                 connect[key] = max(1, self.hidden)
 */
  __pyx_t_6 = 0;
  if (unlikely(__pyx_v_connect == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
    __PYX_ERR(0, 113, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_connect, 0, __pyx_n_s_keys, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_9, &__pyx_t_6, &__pyx_t_3, NULL, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_11 == 0)) break;
    if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":114
 *         #ajustement des connectivites. Si la valeur est -1, on la met a self.hidden
 *         for key in connect.keys():
 *             if connect[key] == -1:             # <<<<<<<<<<<<<<
 *                 connect[key] = max(1, self.hidden)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":115
 *         for key in connect.keys():
 *             if connect[key] == -1:
 *                 connect[key] = max(1, self.hidden)             # <<<<<<<<<<<<<<
 * 
 *         # suppression des atomes  connectivit nulle
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = 1;
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_3 = __pyx_t_8;
      } else {
        __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = __pyx_t_13;
        __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_connect, __pyx_v_key, __pyx_t_8) < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":114
 *         #ajustement des connectivites. Si la valeur est -1, on la met a self.hidden
 *         for key in connect.keys():
 *             if connect[key] == -1:             # <<<<<<<<<<<<<<
 *                 connect[key] = max(1, self.hidden)
 * 
 */
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":118
 * 
 *         # suppression des atomes  connectivit nulle
 *         for atom in atoms[-1::-1]:             # <<<<<<<<<<<<<<
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_atoms, __pyx_slice__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_8);
      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, 118, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_atom, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":119
 *         # suppression des atomes  connectivit nulle
 *         for atom in atoms[-1::-1]:
 *             if atom in connect.keys():             # <<<<<<<<<<<<<<
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_connect, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_atom, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":120
 *         for atom in atoms[-1::-1]:
 *             if atom in connect.keys():
 *                 if not connect[atom]:             # <<<<<<<<<<<<<<
 *                     atoms.pop(atoms.index(atom))
 *             atom = atom.lower()
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_atom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = ((!__pyx_t_5) != 0);
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":121
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))             # <<<<<<<<<<<<<<
 *             atom = atom.lower()
 *             if atom in connect.keys():
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_atom); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_atom};
            __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_13);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_atom};
            __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_13);
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 121, __pyx_L1_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_atom);
            __Pyx_GIVEREF(__pyx_v_atom);
            PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_atom);
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_13};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __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_1, __pyx_t_13};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_13);
            __pyx_t_13 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":120
 *         for atom in atoms[-1::-1]:
 *             if atom in connect.keys():
 *                 if not connect[atom]:             # <<<<<<<<<<<<<<
 *                     atoms.pop(atoms.index(atom))
 *             atom = atom.lower()
 */
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":119
 *         # suppression des atomes  connectivit nulle
 *         for atom in atoms[-1::-1]:
 *             if atom in connect.keys():             # <<<<<<<<<<<<<<
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":122
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 *             atom = atom.lower()             # <<<<<<<<<<<<<<
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_atom, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_15) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_atom, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":123
 *                     atoms.pop(atoms.index(atom))
 *             atom = atom.lower()
 *             if atom in connect.keys():             # <<<<<<<<<<<<<<
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_connect, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_15) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_atom, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":124
 *             atom = atom.lower()
 *             if atom in connect.keys():
 *                 if not connect[atom]:             # <<<<<<<<<<<<<<
 *                     atoms.pop(atoms.index(atom))
 *         self.natom = len(atoms)
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_atom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = ((!__pyx_t_5) != 0);
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":125
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))             # <<<<<<<<<<<<<<
 *         self.natom = len(atoms)
 * 
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_index); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 125, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_atom); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_atom};
            __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_15);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_atom};
            __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_15);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_INCREF(__pyx_v_atom);
            __Pyx_GIVEREF(__pyx_v_atom);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_atom);
            __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        }
        __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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_15};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_15};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
            __Pyx_GIVEREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_15);
            __pyx_t_15 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":124
 *             atom = atom.lower()
 *             if atom in connect.keys():
 *                 if not connect[atom]:             # <<<<<<<<<<<<<<
 *                     atoms.pop(atoms.index(atom))
 *         self.natom = len(atoms)
 */
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":123
 *                     atoms.pop(atoms.index(atom))
 *             atom = atom.lower()
 *             if atom in connect.keys():             # <<<<<<<<<<<<<<
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":118
 * 
 *         # suppression des atomes  connectivit nulle
 *         for atom in atoms[-1::-1]:             # <<<<<<<<<<<<<<
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 */
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":126
 *                 if not connect[atom]:
 *                     atoms.pop(atoms.index(atom))
 *         self.natom = len(atoms)             # <<<<<<<<<<<<<<
 * 
 *         # Ajustement de StickerList et ChargeList
 */
  __pyx_t_9 = PyObject_Length(__pyx_v_atoms); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 126, __pyx_L1_error)
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_natom, __pyx_t_8) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":129
 * 
 *         # Ajustement de StickerList et ChargeList
 *         if stickerlist is None:             # <<<<<<<<<<<<<<
 *             stickerlist = []
 *         if chargelist is None:
 */
  __pyx_t_4 = (__pyx_v_stickerlist == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":130
 *         # Ajustement de StickerList et ChargeList
 *         if stickerlist is None:
 *             stickerlist = []             # <<<<<<<<<<<<<<
 *         if chargelist is None:
 *             chargelist = []
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF_SET(__pyx_v_stickerlist, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":129
 * 
 *         # Ajustement de StickerList et ChargeList
 *         if stickerlist is None:             # <<<<<<<<<<<<<<
 *             stickerlist = []
 *         if chargelist is None:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":131
 *         if stickerlist is None:
 *             stickerlist = []
 *         if chargelist is None:             # <<<<<<<<<<<<<<
 *             chargelist = []
 *             for key, val in connect.items():
 */
  __pyx_t_5 = (__pyx_v_chargelist == Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":132
 *             stickerlist = []
 *         if chargelist is None:
 *             chargelist = []             # <<<<<<<<<<<<<<
 *             for key, val in connect.items():
 *                 if int(val) and (key in ["qp1", "qp2", "qp3", "qp4", "qm1", "qm2", "qm3", "pm4"]):
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF_SET(__pyx_v_chargelist, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":133
 *         if chargelist is None:
 *             chargelist = []
 *             for key, val in connect.items():             # <<<<<<<<<<<<<<
 *                 if int(val) and (key in ["qp1", "qp2", "qp3", "qp4", "qm1", "qm2", "qm3", "pm4"]):
 *                     chargelist.append(key)
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_connect == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 133, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_connect, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_8);
    __pyx_t_8 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_6, &__pyx_t_9, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_10);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":134
 *             chargelist = []
 *             for key, val in connect.items():
 *                 if int(val) and (key in ["qp1", "qp2", "qp3", "qp4", "qm1", "qm2", "qm3", "pm4"]):             # <<<<<<<<<<<<<<
 *                     chargelist.append(key)
 * 
 */
      __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L25_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_key);
      __pyx_t_3 = __pyx_v_key;
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qp1, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qp2, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qp3, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qp4, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qm1, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qm2, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_qm3, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      if (!__pyx_t_16) {
      } else {
        __pyx_t_5 = __pyx_t_16;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_pm4, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
      __pyx_t_5 = __pyx_t_16;
      __pyx_L27_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_16 = (__pyx_t_5 != 0);
      __pyx_t_4 = __pyx_t_16;
      __pyx_L25_bool_binop_done:;
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":135
 *             for key, val in connect.items():
 *                 if int(val) and (key in ["qp1", "qp2", "qp3", "qp4", "qm1", "qm2", "qm3", "pm4"]):
 *                     chargelist.append(key)             # <<<<<<<<<<<<<<
 * 
 *         # preparation de la liste des noms de la couche d'entree
 */
        __pyx_t_17 = __Pyx_PyObject_Append(__pyx_v_chargelist, __pyx_v_key); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 135, __pyx_L1_error)

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":134
 *             chargelist = []
 *             for key, val in connect.items():
 *                 if int(val) and (key in ["qp1", "qp2", "qp3", "qp4", "qm1", "qm2", "qm3", "pm4"]):             # <<<<<<<<<<<<<<
 *                     chargelist.append(key)
 * 
 */
      }
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":131
 *         if stickerlist is None:
 *             stickerlist = []
 *         if chargelist is None:             # <<<<<<<<<<<<<<
 *             chargelist = []
 *             for key, val in connect.items():
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":138
 * 
 *         # preparation de la liste des noms de la couche d'entree
 *         inlist = list(atoms)             # <<<<<<<<<<<<<<
 * 
 *         if isomer: # ajout des 2 entres pour les isomres
 */
  __pyx_t_8 = PySequence_List(__pyx_v_atoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_inlist = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":140
 *         inlist = list(atoms)
 * 
 *         if isomer: # ajout des 2 entres pour les isomres             # <<<<<<<<<<<<<<
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_isomer); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":141
 * 
 *         if isomer: # ajout des 2 entres pour les isomres
 *             inlist.extend([isokey(index) for index in [1, 2]])             # <<<<<<<<<<<<<<
 *         if chirality: # ajout des 2 entres pour les chiralits
 *             inlist.extend([chikey(index) for index in [1, 2]])
 */
    { /* enter inner scope */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __pyx_L38_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __pyx_tuple__5; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      for (;;) {
        if (__pyx_t_6 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 141, __pyx_L38_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_index, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 141, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        if (!__pyx_t_15) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_8genexpr1__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L38_error)
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_8genexpr1__pyx_v_index};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L38_error)
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_8genexpr1__pyx_v_index};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L38_error)
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L38_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __pyx_t_15 = NULL;
            __Pyx_INCREF(__pyx_8genexpr1__pyx_v_index);
            __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_index);
            PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_8genexpr1__pyx_v_index);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L38_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 141, __pyx_L38_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_index); __pyx_8genexpr1__pyx_v_index = 0;
      goto __pyx_L41_exit_scope;
      __pyx_L38_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_index); __pyx_8genexpr1__pyx_v_index = 0;
      goto __pyx_L1_error;
      __pyx_L41_exit_scope:;
    } /* exit inner scope */
    __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_inlist, __pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 141, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":140
 *         inlist = list(atoms)
 * 
 *         if isomer: # ajout des 2 entres pour les isomres             # <<<<<<<<<<<<<<
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":142
 *         if isomer: # ajout des 2 entres pour les isomres
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits             # <<<<<<<<<<<<<<
 *             inlist.extend([chikey(index) for index in [1, 2]])
 *         # ajout des entres pour les degrs suprieurs  1
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_chirality); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":143
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits
 *             inlist.extend([chikey(index) for index in [1, 2]])             # <<<<<<<<<<<<<<
 *         # ajout des entres pour les degrs suprieurs  1
 *         inlist.extend([gradekey(index + 2) for index in range(maxgrade-1)])
 */
    { /* enter inner scope */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L45_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __pyx_tuple__6; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      for (;;) {
        if (__pyx_t_6 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 143, __pyx_L45_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L45_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_index, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_chikey); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 143, __pyx_L45_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_8genexpr2__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_8genexpr2__pyx_v_index};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L45_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_8genexpr2__pyx_v_index};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L45_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 143, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
            __Pyx_INCREF(__pyx_8genexpr2__pyx_v_index);
            __Pyx_GIVEREF(__pyx_8genexpr2__pyx_v_index);
            PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_8genexpr2__pyx_v_index);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 143, __pyx_L45_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index); __pyx_8genexpr2__pyx_v_index = 0;
      goto __pyx_L48_exit_scope;
      __pyx_L45_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index); __pyx_8genexpr2__pyx_v_index = 0;
      goto __pyx_L1_error;
      __pyx_L48_exit_scope:;
    } /* exit inner scope */
    __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_inlist, __pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 143, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":142
 *         if isomer: # ajout des 2 entres pour les isomres
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits             # <<<<<<<<<<<<<<
 *             inlist.extend([chikey(index) for index in [1, 2]])
 *         # ajout des entres pour les degrs suprieurs  1
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":145
 *             inlist.extend([chikey(index) for index in [1, 2]])
 *         # ajout des entres pour les degrs suprieurs  1
 *         inlist.extend([gradekey(index + 2) for index in range(maxgrade-1)])             # <<<<<<<<<<<<<<
 *         inlist.extend(chargelist)
 *         inlist.extend(stickerlist)
 */
  { /* enter inner scope */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __pyx_L51_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_maxgrade, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L51_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L51_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L51_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L51_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= 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_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L51_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__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, 145, __pyx_L51_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_index, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_gradekey); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 145, __pyx_L51_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_8genexpr3__pyx_v_index, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 145, __pyx_L51_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
        }
      }
      if (!__pyx_t_13) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_15};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_15};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __pyx_t_13 = NULL;
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L51_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 145, __pyx_L51_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_index); __pyx_8genexpr3__pyx_v_index = 0;
    goto __pyx_L54_exit_scope;
    __pyx_L51_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_index); __pyx_8genexpr3__pyx_v_index = 0;
    goto __pyx_L1_error;
    __pyx_L54_exit_scope:;
  } /* exit inner scope */
  __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_inlist, __pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":146
 *         # ajout des entres pour les degrs suprieurs  1
 *         inlist.extend([gradekey(index + 2) for index in range(maxgrade-1)])
 *         inlist.extend(chargelist)             # <<<<<<<<<<<<<<
 *         inlist.extend(stickerlist)
 * 
 */
  __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_inlist, __pyx_v_chargelist); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 146, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":147
 *         inlist.extend([gradekey(index + 2) for index in range(maxgrade-1)])
 *         inlist.extend(chargelist)
 *         inlist.extend(stickerlist)             # <<<<<<<<<<<<<<
 * 
 *         # preparation de la description de la premiere couche cachee layername = '_' if self.singlelayer else 'H0'
 */
  __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_inlist, __pyx_v_stickerlist); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":150
 * 
 *         # preparation de la description de la premiere couche cachee layername = '_' if self.singlelayer else 'H0'
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             H1layerdata = LayerData(name='_', index=1, length=int(self.hidden), activfunc='')
 *         else:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":151
 *         # preparation de la description de la premiere couche cachee layername = '_' if self.singlelayer else 'H0'
 *         if self.singlelayer:
 *             H1layerdata = LayerData(name='_', index=1, length=int(self.hidden), activfunc='')             # <<<<<<<<<<<<<<
 *         else:
 *             H1layerdata = LayerData(name='H0', index=1, length=int(self.hidden), activfunc='')
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_LayerData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u__7) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_int_1) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_14) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_activfunc, __pyx_kp_u_) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_H1layerdata = __pyx_t_14;
    __pyx_t_14 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":150
 * 
 *         # preparation de la description de la premiere couche cachee layername = '_' if self.singlelayer else 'H0'
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             H1layerdata = LayerData(name='_', index=1, length=int(self.hidden), activfunc='')
 *         else:
 */
    goto __pyx_L55;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":153
 *             H1layerdata = LayerData(name='_', index=1, length=int(self.hidden), activfunc='')
 *         else:
 *             H1layerdata = LayerData(name='H0', index=1, length=int(self.hidden), activfunc='')             # <<<<<<<<<<<<<<
 * 
 *         # preparation de la description de la deuxieme couche cachee
 */
  /*else*/ {
    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_LayerData); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_H0) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_int_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_activfunc, __pyx_kp_u_) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_H1layerdata = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L55:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":157
 *         # preparation de la description de la deuxieme couche cachee
 * 
 *         H2layerdata = LayerData(name='H1', index=2, length=int(self.hidden), activfunc=afunc)             # <<<<<<<<<<<<<<
 * 
 *         # preparation de la description de la couche de sortie
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LayerData); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_H1) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_int_2) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_activfunc, __pyx_v_afunc) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_H2layerdata = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":160
 * 
 *         # preparation de la description de la couche de sortie
 *         layerlist = [H1layerdata, H2layerdata] if not self.singlelayer else [H1layerdata]             # <<<<<<<<<<<<<<
 * 
 *         outfunc = "SIGMOID" if classif else ""
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (((!__pyx_t_4) != 0)) {
    __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_H1layerdata);
    __Pyx_GIVEREF(__pyx_v_H1layerdata);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_H1layerdata);
    __Pyx_INCREF(__pyx_v_H2layerdata);
    __Pyx_GIVEREF(__pyx_v_H2layerdata);
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_H2layerdata);
    __pyx_t_8 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_H1layerdata);
    __Pyx_GIVEREF(__pyx_v_H1layerdata);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_H1layerdata);
    __pyx_t_8 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_layerlist = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":162
 *         layerlist = [H1layerdata, H2layerdata] if not self.singlelayer else [H1layerdata]
 * 
 *         outfunc = "SIGMOID" if classif else ""             # <<<<<<<<<<<<<<
 * 
 *     # creation du squelette grossier sans synapses
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_classif); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_n_u_SIGMOID);
    __pyx_t_8 = __pyx_n_u_SIGMOID;
  } else {
    __Pyx_INCREF(__pyx_kp_u_);
    __pyx_t_8 = __pyx_kp_u_;
  }
  __pyx_v_outfunc = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":166
 *     # creation du squelette grossier sans synapses
 * 
 *         self.driver = factory(inputs=inlist, modelname=modelname,             # <<<<<<<<<<<<<<
 *                                   outputs=outputname, nosynapse=1)
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_factory); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inputs, __pyx_v_inlist) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_modelname, __pyx_v_modelname) < 0) __PYX_ERR(0, 166, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":167
 * 
 *         self.driver = factory(inputs=inlist, modelname=modelname,
 *                                   outputs=outputname, nosynapse=1)             # <<<<<<<<<<<<<<
 * 
 *         self.driver.mainModel._extraInputCount = 1
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_outputs, __pyx_v_outputname) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nosynapse, __pyx_int_1) < 0) __PYX_ERR(0, 166, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":166
 *     # creation du squelette grossier sans synapses
 * 
 *         self.driver = factory(inputs=inlist, modelname=modelname,             # <<<<<<<<<<<<<<
 *                                   outputs=outputname, nosynapse=1)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_driver, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":169
 *                                   outputs=outputname, nosynapse=1)
 * 
 *         self.driver.mainModel._extraInputCount = 1             # <<<<<<<<<<<<<<
 *         #with open("D:\\Projets\\tempold.nml", "w") as ff: ff.write(st)
 *         #if not newfactory:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_extraInputCount, __pyx_int_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":173
 *         #if not newfactory:
 *         #self.driver.info[C.OLD_NML_FORMAT] = 1
 *         self.addLayers(layerlist)             # <<<<<<<<<<<<<<
 *         self.setOutputParams(outfunc)
 *         st = 'python generated for graph machine %s'
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLayers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_layerlist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_layerlist};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_layerlist};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_layerlist);
      __Pyx_GIVEREF(__pyx_v_layerlist);
      PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_layerlist);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":174
 *         #self.driver.info[C.OLD_NML_FORMAT] = 1
 *         self.addLayers(layerlist)
 *         self.setOutputParams(outfunc)             # <<<<<<<<<<<<<<
 *         st = 'python generated for graph machine %s'
 *         #if newfactory:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setOutputParams); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_14) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_outfunc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __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_14, __pyx_v_outfunc};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 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_14, __pyx_v_outfunc};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __pyx_t_14 = NULL;
      __Pyx_INCREF(__pyx_v_outfunc);
      __Pyx_GIVEREF(__pyx_v_outfunc);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_outfunc);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":175
 *         self.addLayers(layerlist)
 *         self.setOutputParams(outfunc)
 *         st = 'python generated for graph machine %s'             # <<<<<<<<<<<<<<
 *         #if newfactory:
 *         st = st % "(monalPy)"
 */
  __Pyx_INCREF(__pyx_kp_u_python_generated_for_graph_machi);
  __pyx_v_st = __pyx_kp_u_python_generated_for_graph_machi;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":177
 *         st = 'python generated for graph machine %s'
 *         #if newfactory:
 *         st = st % "(monalPy)"             # <<<<<<<<<<<<<<
 *         #else:
 *         #    st = st % "(ndkInterface)"
 */
  __pyx_t_3 = PyUnicode_Format(__pyx_v_st, __pyx_kp_u_monalPy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_st, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":180
 *         #else:
 *         #    st = st % "(ndkInterface)"
 *         self.driver.addComment(st)             # <<<<<<<<<<<<<<
 *         if self.singlelayer:
 *             self.driver.addComment("linear single layer")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_addComment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_st};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __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_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_st};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_st);
      __Pyx_GIVEREF(__pyx_v_st);
      PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_st);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":181
 *         #    st = st % "(ndkInterface)"
 *         self.driver.addComment(st)
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             self.driver.addComment("linear single layer")
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":182
 *         self.driver.addComment(st)
 *         if self.singlelayer:
 *             self.driver.addComment("linear single layer")             # <<<<<<<<<<<<<<
 *         else:
 *             self.driver.addComment("hiddenatom=%d"% self.hidden)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addComment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":181
 *         #    st = st % "(ndkInterface)"
 *         self.driver.addComment(st)
 *         if self.singlelayer:             # <<<<<<<<<<<<<<
 *             self.driver.addComment("linear single layer")
 *         else:
 */
    goto __pyx_L56;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":184
 *             self.driver.addComment("linear single layer")
 *         else:
 *             self.driver.addComment("hiddenatom=%d"% self.hidden)             # <<<<<<<<<<<<<<
 * 
 *         #=======================================================================
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_addComment); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_hiddenatom_d, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L56:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":200
 *         #   juste avant la fusion dans le modele de molecule.
 * 
 *         for key, value in connect.items():             # <<<<<<<<<<<<<<
 *             if value:
 *                 connect[key] = max(1, min(value, hidden))
 */
  __pyx_t_6 = 0;
  if (unlikely(__pyx_v_connect == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 200, __pyx_L1_error)
  }
  __pyx_t_14 = __Pyx_dict_iterator(__pyx_v_connect, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_3);
  __pyx_t_3 = __pyx_t_14;
  __pyx_t_14 = 0;
  while (1) {
    __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_9, &__pyx_t_6, &__pyx_t_14, &__pyx_t_1, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_11 == 0)) break;
    if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":201
 * 
 *         for key, value in connect.items():
 *             if value:             # <<<<<<<<<<<<<<
 *                 connect[key] = max(1, min(value, hidden))
 *         # numerotation prioritaire par la couche d'entre
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":202
 *         for key, value in connect.items():
 *             if value:
 *                 connect[key] = max(1, min(value, hidden))             # <<<<<<<<<<<<<<
 *         # numerotation prioritaire par la couche d'entre
 *         curID = -1
 */
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_1 = __pyx_v_hidden;
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_14 = __pyx_v_value;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_2 = __pyx_t_1;
      } else {
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_2 = __pyx_t_14;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_12 = 1;
      __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_2 = __pyx_t_1;
      } else {
        __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __pyx_t_8;
        __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_connect, __pyx_v_key, __pyx_t_1) < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":201
 * 
 *         for key, value in connect.items():
 *             if value:             # <<<<<<<<<<<<<<
 *                 connect[key] = max(1, min(value, hidden))
 *         # numerotation prioritaire par la couche d'entre
 */
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":204
 *                 connect[key] = max(1, min(value, hidden))
 *         # numerotation prioritaire par la couche d'entre
 *         curID = -1             # <<<<<<<<<<<<<<
 *         for atom in atoms:
 *             # pour tous les atomes
 */
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_v_curID = __pyx_int_neg_1;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":205
 *         # numerotation prioritaire par la couche d'entre
 *         curID = -1
 *         for atom in atoms:             # <<<<<<<<<<<<<<
 *             # pour tous les atomes
 *             curID += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_v_atoms)) {
    __pyx_t_3 = __pyx_v_atoms; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_atoms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __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, 205, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_9 >= 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_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_9 >= 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_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__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, 205, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_atom, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":207
 *         for atom in atoms:
 *             # pour tous les atomes
 *             curID += 1             # <<<<<<<<<<<<<<
 *             if (atom == 'C') and not actionC1:
 *                 # Pour l'atome C si actionC1 == 0
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":208
 *             # pour tous les atomes
 *             curID += 1
 *             if (atom == 'C') and not actionC1:             # <<<<<<<<<<<<<<
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue
 */
    __pyx_t_16 = (__Pyx_PyUnicode_Equals(__pyx_v_atom, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
    if (__pyx_t_16) {
    } else {
      __pyx_t_4 = __pyx_t_16;
      goto __pyx_L63_bool_binop_done;
    }
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_actionC1); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
    __pyx_t_5 = ((!__pyx_t_16) != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L63_bool_binop_done:;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":210
 *             if (atom == 'C') and not actionC1:
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue             # <<<<<<<<<<<<<<
 *             try:
 *                 cc = connect[atom]
 */
      goto __pyx_L60_continue;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":208
 *             # pour tous les atomes
 *             curID += 1
 *             if (atom == 'C') and not actionC1:             # <<<<<<<<<<<<<<
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":211
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[atom]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":212
 *                 continue
 *             try:
 *                 cc = connect[atom]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc =-1
 */
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_atom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L65_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":211
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[atom]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L72_try_end;
      __pyx_L65_error:;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":213
 *             try:
 *                 cc = connect[atom]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc =-1
 *             if cc == -1:# modif du 5/11/2014
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 213, __pyx_L67_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_8);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":214
 *                 cc = connect[atom]
 *             except:
 *                 cc =-1             # <<<<<<<<<<<<<<
 *             if cc == -1:# modif du 5/11/2014
 *                 cc = max(1, hidden)
 */
        __Pyx_INCREF(__pyx_int_neg_1);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_int_neg_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L66_exception_handled;
      }
      __pyx_L67_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":211
 *                 # Pour l'atome C si actionC1 == 0
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[atom]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      goto __pyx_L1_error;
      __pyx_L66_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __pyx_L72_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":215
 *             except:
 *                 cc =-1
 *             if cc == -1:# modif du 5/11/2014             # <<<<<<<<<<<<<<
 *                 cc = max(1, hidden)
 *             #cc = max(cc, 1)
 */
    __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":216
 *                 cc =-1
 *             if cc == -1:# modif du 5/11/2014
 *                 cc = max(1, hidden)             # <<<<<<<<<<<<<<
 *             #cc = max(cc, 1)
 *             for targetindex in range(cc):
 */
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_8 = __pyx_v_hidden;
      __pyx_t_12 = 1;
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_2 = __pyx_t_8;
      } else {
        __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_2 = __pyx_t_14;
        __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":215
 *             except:
 *                 cc =-1
 *             if cc == -1:# modif du 5/11/2014             # <<<<<<<<<<<<<<
 *                 cc = max(1, hidden)
 *             #cc = max(cc, 1)
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":218
 *                 cc = max(1, hidden)
 *             #cc = max(cc, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 if (atom == 'C') and actionC1:
 *                     self.addLink(0, 0, 1, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL
 */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_21 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_21 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 218, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_21)) {
        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_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 218, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 218, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_21(__pyx_t_2);
        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, 218, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":219
 *             #cc = max(cc, 1)
 *             for targetindex in range(cc):
 *                 if (atom == 'C') and actionC1:             # <<<<<<<<<<<<<<
 *                     self.addLink(0, 0, 1, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL
 *                 else:
 */
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_atom, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
      if (__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L79_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_actionC1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
      __pyx_t_4 = __pyx_t_5;
      __pyx_L79_bool_binop_done:;
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":220
 *             for targetindex in range(cc):
 *                 if (atom == 'C') and actionC1:
 *                     self.addLink(0, 0, 1, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL             # <<<<<<<<<<<<<<
 *                 else:
 *                     # pour tous les autres cas
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_int_0);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_0);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_int_1);
        __Pyx_INCREF(__pyx_v_targetindex);
        __Pyx_GIVEREF(__pyx_v_targetindex);
        PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_targetindex);
        __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_LS_FIXE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_style, __pyx_t_13) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, __pyx_float_1_0) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":219
 *             #cc = max(cc, 1)
 *             for targetindex in range(cc):
 *                 if (atom == 'C') and actionC1:             # <<<<<<<<<<<<<<
 *                     self.addLink(0, 0, 1, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL
 *                 else:
 */
        goto __pyx_L78;
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":223
 *                 else:
 *                     # pour tous les autres cas
 *                     name = "%s-H%d"% (atom, targetindex)             # <<<<<<<<<<<<<<
 *                     self.addLink(0, curID, 1, targetindex, name)
 * 
 */
      /*else*/ {
        __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_22 = 0;
        __pyx_t_23 = 127;
        __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_atom), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
        __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_INCREF(__pyx_kp_u_H);
        __pyx_t_22 += 2;
        __Pyx_GIVEREF(__pyx_kp_u_H);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_kp_u_H);
        __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
        __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_13, 3, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":224
 *                     # pour tous les autres cas
 *                     name = "%s-H%d"% (atom, targetindex)
 *                     self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 * 
 *         if isomer:
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[6] = {__pyx_t_14, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[6] = {__pyx_t_14, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_int_0);
          __Pyx_INCREF(__pyx_v_curID);
          __Pyx_GIVEREF(__pyx_v_curID);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_curID);
          __Pyx_INCREF(__pyx_int_1);
          __Pyx_GIVEREF(__pyx_int_1);
          PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_10, __pyx_int_1);
          __Pyx_INCREF(__pyx_v_targetindex);
          __Pyx_GIVEREF(__pyx_v_targetindex);
          PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_10, __pyx_v_targetindex);
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_10, __pyx_v_name);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L78:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":218
 *                 cc = max(1, hidden)
 *             #cc = max(cc, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 if (atom == 'C') and actionC1:
 *                     self.addLink(0, 0, 1, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":205
 *         # numerotation prioritaire par la couche d'entre
 *         curID = -1
 *         for atom in atoms:             # <<<<<<<<<<<<<<
 *             # pour tous les atomes
 *             curID += 1
 */
    __pyx_L60_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":226
 *                     self.addLink(0, curID, 1, targetindex, name)
 * 
 *         if isomer:             # <<<<<<<<<<<<<<
 *             # pour les isomries 1 et 2
 *             try:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_isomer); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 226, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":228
 *         if isomer:
 *             # pour les isomries 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[isokey(0)]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":229
 *             # pour les isomries 1 et 2
 *             try:
 *                 cc = connect[isokey(0)]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc = 0
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L82_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L82_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L82_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":228
 *         if isomer:
 *             # pour les isomries 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[isokey(0)]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L87_try_end;
      __pyx_L82_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __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;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":230
 *             try:
 *                 cc = connect[isokey(0)]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc = 0
 *             if cc == -1:
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 230, __pyx_L84_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_1);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":231
 *                 cc = connect[isokey(0)]
 *             except:
 *                 cc = 0             # <<<<<<<<<<<<<<
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_int_0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L83_exception_handled;
      }
      __pyx_L84_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":228
 *         if isomer:
 *             # pour les isomries 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[isokey(0)]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      goto __pyx_L1_error;
      __pyx_L83_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __pyx_L87_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":232
 *             except:
 *                 cc = 0
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             if cc:
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":233
 *                 cc = 0
 *             if cc == -1:
 *                 cc = max(hidden, 1)             # <<<<<<<<<<<<<<
 *             if cc:
 *                 for iIso in [1,2]:
 */
      __pyx_t_12 = 1;
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_1 = __pyx_v_hidden;
      __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_4) {
        __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_2 = __pyx_t_13;
        __pyx_t_13 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_2 = __pyx_t_1;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":232
 *             except:
 *                 cc = 0
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             if cc:
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":234
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             if cc:             # <<<<<<<<<<<<<<
 *                 for iIso in [1,2]:
 *                     curID += 1
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cc); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":235
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
      __pyx_t_1 = __pyx_tuple__10; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      for (;;) {
        if (__pyx_t_9 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_iIso, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":236
 *             if cc:
 *                 for iIso in [1,2]:
 *                     curID += 1             # <<<<<<<<<<<<<<
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 */
        __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":237
 *                 for iIso in [1,2]:
 *                     curID += 1
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
          __pyx_t_13 = __pyx_t_2; __Pyx_INCREF(__pyx_t_13); __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 237, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_7 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_13))) {
              if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            } else {
              if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            }
          } else {
            __pyx_t_2 = __pyx_t_7(__pyx_t_13);
            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, 237, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":238
 *                     curID += 1
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)             # <<<<<<<<<<<<<<
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 */
          __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_22 = 0;
          __pyx_t_23 = 127;
          __Pyx_INCREF(__pyx_n_u_Iso);
          __pyx_t_22 += 3;
          __Pyx_GIVEREF(__pyx_n_u_Iso);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_Iso);
          __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_iIso, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
          __pyx_t_3 = 0;
          __Pyx_INCREF(__pyx_kp_u_H);
          __pyx_t_22 += 2;
          __Pyx_GIVEREF(__pyx_kp_u_H);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_H);
          __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":239
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 *             else:
 *                 for iIso in [1,2]:
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = NULL;
          __pyx_t_10 = 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_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_3);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_3);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 239, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_8) {
              __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL;
            }
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_GIVEREF(__pyx_int_0);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_10, __pyx_int_0);
            __Pyx_INCREF(__pyx_v_curID);
            __Pyx_GIVEREF(__pyx_v_curID);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_10, __pyx_v_curID);
            __Pyx_INCREF(__pyx_int_1);
            __Pyx_GIVEREF(__pyx_int_1);
            PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_10, __pyx_int_1);
            __Pyx_INCREF(__pyx_v_targetindex);
            __Pyx_GIVEREF(__pyx_v_targetindex);
            PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_10, __pyx_v_targetindex);
            __Pyx_INCREF(__pyx_v_name);
            __Pyx_GIVEREF(__pyx_v_name);
            PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_10, __pyx_v_name);
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":237
 *                 for iIso in [1,2]:
 *                     curID += 1
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":235
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":234
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             if cc:             # <<<<<<<<<<<<<<
 *                 for iIso in [1,2]:
 *                     curID += 1
 */
      goto __pyx_L91;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":241
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 */
    /*else*/ {
      __pyx_t_1 = __pyx_tuple__11; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      for (;;) {
        if (__pyx_t_9 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_13); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
        #else
        __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_iIso, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":243
 *                 for iIso in [1,2]:
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1             # <<<<<<<<<<<<<<
 *                     try:
 *                         cc = connect[isokey(iIso)]
 */
        __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":244
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[isokey(iIso)]
 *                     except:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          /*try:*/ {

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":245
 *                     curID += 1
 *                     try:
 *                         cc = connect[isokey(iIso)]             # <<<<<<<<<<<<<<
 *                     except:
 *                         cc = -1
 */
            __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L98_error)
            __Pyx_GOTREF(__pyx_t_3);
            __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_13 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_iIso); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 245, __pyx_L98_error)
              __Pyx_GOTREF(__pyx_t_13);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_3)) {
                PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_iIso};
                __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 245, __pyx_L98_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_3)) {
                PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_iIso};
                __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 245, __pyx_L98_error)
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_GOTREF(__pyx_t_13);
              } else
              #endif
              {
                __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 245, __pyx_L98_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL;
                __Pyx_INCREF(__pyx_v_iIso);
                __Pyx_GIVEREF(__pyx_v_iIso);
                PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_iIso);
                __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 245, __pyx_L98_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L98_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":244
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[isokey(iIso)]
 *                     except:
 */
          }
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L105_try_end;
          __pyx_L98_error:;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":246
 *                     try:
 *                         cc = connect[isokey(iIso)]
 *                     except:             # <<<<<<<<<<<<<<
 *                         cc = -1
 *                     if cc == -1:
 */
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_13, &__pyx_t_14) < 0) __PYX_ERR(0, 246, __pyx_L100_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_14);

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":247
 *                         cc = connect[isokey(iIso)]
 *                     except:
 *                         cc = -1             # <<<<<<<<<<<<<<
 *                     if cc == -1:
 *                         cc = max(hidden, 1)
 */
            __Pyx_INCREF(__pyx_int_neg_1);
            __Pyx_DECREF_SET(__pyx_v_cc, __pyx_int_neg_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L99_exception_handled;
          }
          __pyx_L100_except_error:;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":244
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[isokey(iIso)]
 *                     except:
 */
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          goto __pyx_L1_error;
          __pyx_L99_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_L105_try_end:;
        }

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":248
 *                     except:
 *                         cc = -1
 *                     if cc == -1:             # <<<<<<<<<<<<<<
 *                         cc = max(hidden, 1)
 *                     for targetindex in range(cc):
 */
        __pyx_t_14 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (__pyx_t_4) {

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":249
 *                         cc = -1
 *                     if cc == -1:
 *                         cc = max(hidden, 1)             # <<<<<<<<<<<<<<
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 */
          __pyx_t_12 = 1;
          __Pyx_INCREF(__pyx_v_hidden);
          __pyx_t_14 = __pyx_v_hidden;
          __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_4) {
            __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __pyx_t_2;
            __pyx_t_2 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_14);
            __pyx_t_13 = __pyx_t_14;
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __pyx_t_13;
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_14);
          __pyx_t_14 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":248
 *                     except:
 *                         cc = -1
 *                     if cc == -1:             # <<<<<<<<<<<<<<
 *                         cc = max(hidden, 1)
 *                     for targetindex in range(cc):
 */
        }

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":250
 *                     if cc == -1:
 *                         cc = max(hidden, 1)
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (likely(PyList_CheckExact(__pyx_t_14)) || PyTuple_CheckExact(__pyx_t_14)) {
          __pyx_t_13 = __pyx_t_14; __Pyx_INCREF(__pyx_t_13); __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 250, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_7 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_13))) {
              if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_14 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
              #else
              __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 250, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
              #endif
            } else {
              if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
              #else
              __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 250, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
              #endif
            }
          } else {
            __pyx_t_14 = __pyx_t_7(__pyx_t_13);
            if (unlikely(!__pyx_t_14)) {
              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_14);
          }
          __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_14);
          __pyx_t_14 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":251
 *                         cc = max(hidden, 1)
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)             # <<<<<<<<<<<<<<
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 */
          __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_22 = 0;
          __pyx_t_23 = 127;
          __Pyx_INCREF(__pyx_n_u_Iso);
          __pyx_t_22 += 3;
          __Pyx_GIVEREF(__pyx_n_u_Iso);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_n_u_Iso);
          __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_iIso, __pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2);
          __pyx_t_2 = 0;
          __Pyx_INCREF(__pyx_kp_u_H);
          __pyx_t_22 += 2;
          __Pyx_GIVEREF(__pyx_kp_u_H);
          PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_kp_u_H);
          __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_14, 4, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":252
 *                     for targetindex in range(cc):
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 * 
 *         if chirality:
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_3 = NULL;
          __pyx_t_10 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            if (__pyx_t_3) {
              __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
            }
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_GIVEREF(__pyx_int_0);
            PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_int_0);
            __Pyx_INCREF(__pyx_v_curID);
            __Pyx_GIVEREF(__pyx_v_curID);
            PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_curID);
            __Pyx_INCREF(__pyx_int_1);
            __Pyx_GIVEREF(__pyx_int_1);
            PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_10, __pyx_int_1);
            __Pyx_INCREF(__pyx_v_targetindex);
            __Pyx_GIVEREF(__pyx_v_targetindex);
            PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_10, __pyx_v_targetindex);
            __Pyx_INCREF(__pyx_v_name);
            __Pyx_GIVEREF(__pyx_v_name);
            PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_10, __pyx_v_name);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":250
 *                     if cc == -1:
 *                         cc = max(hidden, 1)
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Iso%d-H%d"% (iIso, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":241
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L91:;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":226
 *                     self.addLink(0, curID, 1, targetindex, name)
 * 
 *         if isomer:             # <<<<<<<<<<<<<<
 *             # pour les isomries 1 et 2
 *             try:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":254
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 *         if chirality:             # <<<<<<<<<<<<<<
 *             # pour les chiralits 1 et 2
 *             try:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_chirality); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":256
 *         if chirality:
 *             # pour les chiralits 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[chikey(0)]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":257
 *             # pour les chiralits 1 et 2
 *             try:
 *                 cc = connect[chikey(0)]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc = 0
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chikey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L112_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 257, __pyx_L112_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L112_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":256
 *         if chirality:
 *             # pour les chiralits 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[chikey(0)]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L117_try_end;
      __pyx_L112_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":258
 *             try:
 *                 cc = connect[chikey(0)]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc = 0
 *             if cc == -1:
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_13, &__pyx_t_2) < 0) __PYX_ERR(0, 258, __pyx_L114_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GOTREF(__pyx_t_2);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":259
 *                 cc = connect[chikey(0)]
 *             except:
 *                 cc = 0             # <<<<<<<<<<<<<<
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_int_0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L113_exception_handled;
      }
      __pyx_L114_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":256
 *         if chirality:
 *             # pour les chiralits 1 et 2
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[chikey(0)]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      goto __pyx_L1_error;
      __pyx_L113_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __pyx_L117_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":260
 *             except:
 *                 cc = 0
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             if cc:
 */
    __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":261
 *                 cc = 0
 *             if cc == -1:
 *                 cc = max(hidden, 1)             # <<<<<<<<<<<<<<
 *             if cc:
 *                 for iChi in [1,2]:
 */
      __pyx_t_12 = 1;
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_2 = __pyx_v_hidden;
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (__pyx_t_4) {
        __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = __pyx_t_14;
        __pyx_t_14 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_13 = __pyx_t_2;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_13;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":260
 *             except:
 *                 cc = 0
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             if cc:
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":262
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             if cc:             # <<<<<<<<<<<<<<
 *                 for iChi in [1,2]:
 *                     curID += 1
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cc); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":263
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
      __pyx_t_2 = __pyx_tuple__13; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
      for (;;) {
        if (__pyx_t_9 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_13); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
        #else
        __pyx_t_13 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 263, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_iChi, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":264
 *             if cc:
 *                 for iChi in [1,2]:
 *                     curID += 1             # <<<<<<<<<<<<<<
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 */
        __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":265
 *                 for iChi in [1,2]:
 *                     curID += 1
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
          __pyx_t_14 = __pyx_t_13; __Pyx_INCREF(__pyx_t_14); __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 265, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_7 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_14))) {
              if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_14)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_6); __Pyx_INCREF(__pyx_t_13); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_14, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 265, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_13);
              #endif
            } else {
              if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_6); __Pyx_INCREF(__pyx_t_13); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_14, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 265, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_13);
              #endif
            }
          } else {
            __pyx_t_13 = __pyx_t_7(__pyx_t_14);
            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, 265, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_13);
          }
          __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":266
 *                     curID += 1
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)             # <<<<<<<<<<<<<<
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 */
          __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_22 = 0;
          __pyx_t_23 = 127;
          __Pyx_INCREF(__pyx_n_u_Chi);
          __pyx_t_22 += 3;
          __Pyx_GIVEREF(__pyx_n_u_Chi);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_u_Chi);
          __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_iChi, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
          __pyx_t_1 = 0;
          __Pyx_INCREF(__pyx_kp_u_H);
          __pyx_t_22 += 2;
          __Pyx_GIVEREF(__pyx_kp_u_H);
          PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u_H);
          __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":267
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 *             else:
 *                 for iChi in [1,2]:
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_8 = NULL;
          __pyx_t_10 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
              __pyx_t_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          {
            __pyx_t_3 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            if (__pyx_t_8) {
              __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
            }
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_GIVEREF(__pyx_int_0);
            PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_int_0);
            __Pyx_INCREF(__pyx_v_curID);
            __Pyx_GIVEREF(__pyx_v_curID);
            PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_curID);
            __Pyx_INCREF(__pyx_int_1);
            __Pyx_GIVEREF(__pyx_int_1);
            PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_10, __pyx_int_1);
            __Pyx_INCREF(__pyx_v_targetindex);
            __Pyx_GIVEREF(__pyx_v_targetindex);
            PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_10, __pyx_v_targetindex);
            __Pyx_INCREF(__pyx_v_name);
            __Pyx_GIVEREF(__pyx_v_name);
            PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_10, __pyx_v_name);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":265
 *                 for iChi in [1,2]:
 *                     curID += 1
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":263
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":262
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             if cc:             # <<<<<<<<<<<<<<
 *                 for iChi in [1,2]:
 *                     curID += 1
 */
      goto __pyx_L121;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":269
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     try:
 */
    /*else*/ {
      __pyx_t_2 = __pyx_tuple__14; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
      for (;;) {
        if (__pyx_t_9 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_14); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
        #else
        __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_iChi, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":270
 *             else:
 *                 for iChi in [1,2]:
 *                     curID += 1             # <<<<<<<<<<<<<<
 *                     try:
 *                         cc = connect[chikey(iChi)]
 */
        __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":271
 *                 for iChi in [1,2]:
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[chikey(iChi)]
 *                     except:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          /*try:*/ {

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":272
 *                     curID += 1
 *                     try:
 *                         cc = connect[chikey(iChi)]             # <<<<<<<<<<<<<<
 *                     except:
 *                         cc = -1
 */
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chikey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L128_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_13)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_13);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
              }
            }
            if (!__pyx_t_13) {
              __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_iChi); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 272, __pyx_L128_error)
              __Pyx_GOTREF(__pyx_t_14);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_1)) {
                PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_iChi};
                __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 272, __pyx_L128_error)
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
                PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_iChi};
                __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 272, __pyx_L128_error)
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              {
                __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L128_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __pyx_t_13 = NULL;
                __Pyx_INCREF(__pyx_v_iChi);
                __Pyx_GIVEREF(__pyx_v_iChi);
                PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_iChi);
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 272, __pyx_L128_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L128_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":271
 *                 for iChi in [1,2]:
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[chikey(iChi)]
 *                     except:
 */
          }
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L135_try_end;
          __pyx_L128_error:;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":273
 *                     try:
 *                         cc = connect[chikey(iChi)]
 *                     except:             # <<<<<<<<<<<<<<
 *                         cc = -1
 *                     if cc == -1:
 */
          /*except:*/ {
            __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_3) < 0) __PYX_ERR(0, 273, __pyx_L130_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GOTREF(__pyx_t_3);

            /* "metaphor/chem_gm/core/graphmachineworkshop.py":274
 *                         cc = connect[chikey(iChi)]
 *                     except:
 *                         cc = -1             # <<<<<<<<<<<<<<
 *                     if cc == -1:
 *                         cc =  max(1, hidden)
 */
            __Pyx_INCREF(__pyx_int_neg_1);
            __Pyx_DECREF_SET(__pyx_v_cc, __pyx_int_neg_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L129_exception_handled;
          }
          __pyx_L130_except_error:;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":271
 *                 for iChi in [1,2]:
 *                     curID += 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         cc = connect[chikey(iChi)]
 *                     except:
 */
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          goto __pyx_L1_error;
          __pyx_L129_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_L135_try_end:;
        }

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":275
 *                     except:
 *                         cc = -1
 *                     if cc == -1:             # <<<<<<<<<<<<<<
 *                         cc =  max(1, hidden)
 *                     for targetindex in range(cc):
 */
        __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_4) {

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":276
 *                         cc = -1
 *                     if cc == -1:
 *                         cc =  max(1, hidden)             # <<<<<<<<<<<<<<
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 */
          __Pyx_INCREF(__pyx_v_hidden);
          __pyx_t_3 = __pyx_v_hidden;
          __pyx_t_12 = 1;
          __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_13 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_4) {
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_14 = __pyx_t_3;
          } else {
            __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 276, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_14 = __pyx_t_13;
            __pyx_t_13 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __pyx_t_14;
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":275
 *                     except:
 *                         cc = -1
 *                     if cc == -1:             # <<<<<<<<<<<<<<
 *                         cc =  max(1, hidden)
 *                     for targetindex in range(cc):
 */
        }

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":277
 *                     if cc == -1:
 *                         cc =  max(1, hidden)
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
          __pyx_t_14 = __pyx_t_3; __Pyx_INCREF(__pyx_t_14); __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 277, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_7 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_14))) {
              if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_14)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 277, __pyx_L1_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 277, __pyx_L1_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_7(__pyx_t_14);
            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, 277, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":278
 *                         cc =  max(1, hidden)
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)             # <<<<<<<<<<<<<<
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 */
          __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_22 = 0;
          __pyx_t_23 = 127;
          __Pyx_INCREF(__pyx_n_u_Chi);
          __pyx_t_22 += 3;
          __Pyx_GIVEREF(__pyx_n_u_Chi);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_Chi);
          __pyx_t_13 = __Pyx_PyObject_Format(__pyx_v_iChi, __pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 278, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
          __pyx_t_13 = 0;
          __Pyx_INCREF(__pyx_kp_u_H);
          __pyx_t_22 += 2;
          __Pyx_GIVEREF(__pyx_kp_u_H);
          PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_H);
          __pyx_t_13 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 278, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_23;
          __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_22, __pyx_t_23); 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_XDECREF_SET(__pyx_v_name, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":279
 *                     for targetindex in range(cc):
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 * 
 *         for iDegre in range(2, maxgrade+1):
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = NULL;
          __pyx_t_10 = 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_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_13);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
            __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_13);
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            if (__pyx_t_1) {
              __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
            }
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_GIVEREF(__pyx_int_0);
            PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_int_0);
            __Pyx_INCREF(__pyx_v_curID);
            __Pyx_GIVEREF(__pyx_v_curID);
            PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_curID);
            __Pyx_INCREF(__pyx_int_1);
            __Pyx_GIVEREF(__pyx_int_1);
            PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_10, __pyx_int_1);
            __Pyx_INCREF(__pyx_v_targetindex);
            __Pyx_GIVEREF(__pyx_v_targetindex);
            PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_10, __pyx_v_targetindex);
            __Pyx_INCREF(__pyx_v_name);
            __Pyx_GIVEREF(__pyx_v_name);
            PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_10, __pyx_v_name);
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":277
 *                     if cc == -1:
 *                         cc =  max(1, hidden)
 *                     for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                         name = "Chi%d-H%d"% (iChi, targetindex)
 *                         self.addLink(0, curID, 1, targetindex, name)
 */
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":269
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     try:
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L121:;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":254
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 *         if chirality:             # <<<<<<<<<<<<<<
 *             # pour les chiralits 1 et 2
 *             try:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":281
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 *         for iDegre in range(2, maxgrade+1):             # <<<<<<<<<<<<<<
 *             # pour tous les degrs  partir de 2
 *             curID += 1
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_maxgrade, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_14 = __pyx_t_2; __Pyx_INCREF(__pyx_t_14); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_7 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_14))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_14);
      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, 281, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_iDegre, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":283
 *         for iDegre in range(2, maxgrade+1):
 *             # pour tous les degrs  partir de 2
 *             curID += 1             # <<<<<<<<<<<<<<
 *             try:
 *                 cc = connect[gradekey(iDegre)]
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":284
 *             # pour tous les degrs  partir de 2
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[gradekey(iDegre)]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":285
 *             curID += 1
 *             try:
 *                 cc = connect[gradekey(iDegre)]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc = -1
 */
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_gradekey); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 285, __pyx_L143_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_iDegre); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L143_error)
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_iDegre};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L143_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
            PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_iDegre};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L143_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L143_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_v_iDegre);
            __Pyx_GIVEREF(__pyx_v_iDegre);
            PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_iDegre);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L143_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 285, __pyx_L143_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":284
 *             # pour tous les degrs  partir de 2
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[gradekey(iDegre)]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L150_try_end;
      __pyx_L143_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":286
 *             try:
 *                 cc = connect[gradekey(iDegre)]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc = -1
 *             if cc == -1:
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 286, __pyx_L145_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_8);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":287
 *                 cc = connect[gradekey(iDegre)]
 *             except:
 *                 cc = -1             # <<<<<<<<<<<<<<
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 */
        __Pyx_INCREF(__pyx_int_neg_1);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_int_neg_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L144_exception_handled;
      }
      __pyx_L145_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":284
 *             # pour tous les degrs  partir de 2
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[gradekey(iDegre)]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      goto __pyx_L1_error;
      __pyx_L144_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __pyx_L150_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":288
 *             except:
 *                 cc = -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             for targetindex in range(cc):
 */
    __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":289
 *                 cc = -1
 *             if cc == -1:
 *                 cc = max(hidden, 1)             # <<<<<<<<<<<<<<
 *             for targetindex in range(cc):
 *                 name = "D%d-H%d"% (iDegre, targetindex)
 */
      __pyx_t_12 = 1;
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_8 = __pyx_v_hidden;
      __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_2 = __pyx_t_8;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_cc, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":288
 *             except:
 *                 cc = -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc = max(hidden, 1)
 *             for targetindex in range(cc):
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":290
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 name = "D%d-H%d"% (iDegre, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, name)
 */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_21 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_21 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 290, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_21)) {
        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_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_21(__pyx_t_2);
        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, 290, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":291
 *                 cc = max(hidden, 1)
 *             for targetindex in range(cc):
 *                 name = "D%d-H%d"% (iDegre, targetindex)             # <<<<<<<<<<<<<<
 *                 self.addLink(0, curID, 1, targetindex, name)
 * 
 */
      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_22 = 0;
      __pyx_t_23 = 127;
      __Pyx_INCREF(__pyx_n_u_D);
      __pyx_t_22 += 1;
      __Pyx_GIVEREF(__pyx_n_u_D);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_D);
      __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_iDegre, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u_H);
      __pyx_t_22 += 2;
      __Pyx_GIVEREF(__pyx_kp_u_H);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u_H);
      __pyx_t_3 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":292
 *             for targetindex in range(cc):
 *                 name = "D%d-H%d"% (iDegre, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, name)             # <<<<<<<<<<<<<<
 * 
 *         for name in chargelist:
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_13, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __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_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_13, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_name};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_13) {
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __pyx_t_13 = NULL;
        }
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_curID);
        __Pyx_GIVEREF(__pyx_v_curID);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_v_curID);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_10, __pyx_int_1);
        __Pyx_INCREF(__pyx_v_targetindex);
        __Pyx_GIVEREF(__pyx_v_targetindex);
        PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_10, __pyx_v_targetindex);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_10, __pyx_v_name);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":290
 *             if cc == -1:
 *                 cc = max(hidden, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 name = "D%d-H%d"% (iDegre, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, name)
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":281
 *                         self.addLink(0, curID, 1, targetindex, name)
 * 
 *         for iDegre in range(2, maxgrade+1):             # <<<<<<<<<<<<<<
 *             # pour tous les degrs  partir de 2
 *             curID += 1
 */
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":294
 *                 self.addLink(0, curID, 1, targetindex, name)
 * 
 *         for name in chargelist:             # <<<<<<<<<<<<<<
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_chargelist)) || PyTuple_CheckExact(__pyx_v_chargelist)) {
    __pyx_t_14 = __pyx_v_chargelist; __Pyx_INCREF(__pyx_t_14); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_chargelist); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_7 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_14))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_14);
      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, 294, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":296
 *         for name in chargelist:
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1             # <<<<<<<<<<<<<<
 *             try:
 *                 cc = connect[name]
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":297
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":298
 *             curID += 1
 *             try:
 *                 cc = connect[name]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc -1
 */
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L158_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":297
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L165_try_end;
      __pyx_L158_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":299
 *             try:
 *                 cc = connect[name]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc -1
 *             if cc == -1:
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(0, 299, __pyx_L160_except_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_8);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":300
 *                 cc = connect[name]
 *             except:
 *                 cc -1             # <<<<<<<<<<<<<<
 *             if cc == -1:
 *                 cc =  max(1, hidden)
 */
        if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 300, __pyx_L160_except_error) }
        __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_cc, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L160_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L159_exception_handled;
      }
      __pyx_L160_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":297
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      goto __pyx_L1_error;
      __pyx_L159_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __pyx_L165_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":301
 *             except:
 *                 cc -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc =  max(1, hidden)
 * #             else:
 */
    if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 301, __pyx_L1_error) }
    __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":302
 *                 cc -1
 *             if cc == -1:
 *                 cc =  max(1, hidden)             # <<<<<<<<<<<<<<
 * #             else:
 * #                 cc = min(cc, self.hidden)
 */
      __Pyx_INCREF(__pyx_v_hidden);
      __pyx_t_8 = __pyx_v_hidden;
      __pyx_t_12 = 1;
      __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_3 = __pyx_t_8;
      } else {
        __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":301
 *             except:
 *                 cc -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc =  max(1, hidden)
 * #             else:
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":306
 * #                 cc = min(cc, self.hidden)
 * #                 cc = max(cc, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 */
    if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 306, __pyx_L1_error) }
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_21 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_21 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 306, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_21)) {
        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_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 306, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 306, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_21(__pyx_t_3);
        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, 306, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":307
 * #                 cc = max(cc, 1)
 *             for targetindex in range(cc):
 *                 nameloc = "%s-H%d"% (name, targetindex)             # <<<<<<<<<<<<<<
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 */
      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_22 = 0;
      __pyx_t_23 = 127;
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_H);
      __pyx_t_22 += 2;
      __Pyx_GIVEREF(__pyx_kp_u_H);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u_H);
      __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_nameloc, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":308
 *             for targetindex in range(cc):
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)             # <<<<<<<<<<<<<<
 * 
 *         for name in stickerlist:
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_2, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_nameloc};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __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_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_2, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_nameloc};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_10, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_curID);
        __Pyx_GIVEREF(__pyx_v_curID);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_10, __pyx_v_curID);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_10, __pyx_int_1);
        __Pyx_INCREF(__pyx_v_targetindex);
        __Pyx_GIVEREF(__pyx_v_targetindex);
        PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_10, __pyx_v_targetindex);
        __Pyx_INCREF(__pyx_v_nameloc);
        __Pyx_GIVEREF(__pyx_v_nameloc);
        PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_10, __pyx_v_nameloc);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":306
 * #                 cc = min(cc, self.hidden)
 * #                 cc = max(cc, 1)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":294
 *                 self.addLink(0, curID, 1, targetindex, name)
 * 
 *         for name in chargelist:             # <<<<<<<<<<<<<<
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 */
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":310
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 *         for name in stickerlist:             # <<<<<<<<<<<<<<
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_stickerlist)) || PyTuple_CheckExact(__pyx_v_stickerlist)) {
    __pyx_t_14 = __pyx_v_stickerlist; __Pyx_INCREF(__pyx_t_14); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_stickerlist); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_7 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_14))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_14);
      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, 310, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":312
 *         for name in stickerlist:
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1             # <<<<<<<<<<<<<<
 *             try:
 *                 cc = connect[name]
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_curID, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_curID, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":313
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      /*try:*/ {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":314
 *             curID += 1
 *             try:
 *                 cc = connect[name]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc -1
 */
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_connect, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L173_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":313
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L180_try_end;
      __pyx_L173_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":315
 *             try:
 *                 cc = connect[name]
 *             except:             # <<<<<<<<<<<<<<
 *                 cc -1
 *             if cc == -1:
 */
      /*except:*/ {
        __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 315, __pyx_L175_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_8);

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":316
 *                 cc = connect[name]
 *             except:
 *                 cc -1             # <<<<<<<<<<<<<<
 *             if cc == -1:
 *                 cc =  max(1, self.hidden)
 */
        if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 316, __pyx_L175_except_error) }
        __pyx_t_13 = __Pyx_PyInt_SubtractObjC(__pyx_v_cc, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L175_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L174_exception_handled;
      }
      __pyx_L175_except_error:;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":313
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 *             try:             # <<<<<<<<<<<<<<
 *                 cc = connect[name]
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      goto __pyx_L1_error;
      __pyx_L174_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __pyx_L180_try_end:;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":317
 *             except:
 *                 cc -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc =  max(1, self.hidden)
 *             else:
 */
    if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 317, __pyx_L1_error) }
    __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_cc, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":318
 *                 cc -1
 *             if cc == -1:
 *                 cc =  max(1, self.hidden)             # <<<<<<<<<<<<<<
 *             else:
 *                 cc = min(cc, self.hidden)
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = 1;
      __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_1 = __pyx_t_8;
      } else {
        __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = __pyx_t_13;
        __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":317
 *             except:
 *                 cc -1
 *             if cc == -1:             # <<<<<<<<<<<<<<
 *                 cc =  max(1, self.hidden)
 *             else:
 */
      goto __pyx_L183;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":320
 *                 cc =  max(1, self.hidden)
 *             else:
 *                 cc = min(cc, self.hidden)             # <<<<<<<<<<<<<<
 *             for targetindex in range(cc):
 *                 nameloc = "%s-H%d"% (name, targetindex)
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(!__pyx_v_cc)) { __Pyx_RaiseUnboundLocalError("cc"); __PYX_ERR(0, 320, __pyx_L1_error) }
      __Pyx_INCREF(__pyx_v_cc);
      __pyx_t_1 = __pyx_v_cc;
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 320, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_13 = __pyx_t_8;
      } else {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_13 = __pyx_t_1;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_13;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cc, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __pyx_L183:;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":321
 *             else:
 *                 cc = min(cc, self.hidden)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_cc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_13 = __pyx_t_8; __Pyx_INCREF(__pyx_t_13); __pyx_t_6 = 0;
      __pyx_t_21 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_21 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 321, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_21)) {
        if (likely(PyList_CheckExact(__pyx_t_13))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_13)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_13, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_21(__pyx_t_13);
        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, 321, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":322
 *                 cc = min(cc, self.hidden)
 *             for targetindex in range(cc):
 *                 nameloc = "%s-H%d"% (name, targetindex)             # <<<<<<<<<<<<<<
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 */
      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_22 = 0;
      __pyx_t_23 = 127;
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_H);
      __pyx_t_22 += 2;
      __Pyx_GIVEREF(__pyx_kp_u_H);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u_H);
      __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_targetindex, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_nameloc, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":323
 *             for targetindex in range(cc):
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)             # <<<<<<<<<<<<<<
 * 
 *         if not self.singlelayer:
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_nameloc};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __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_8)) {
        PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_int_0, __pyx_v_curID, __pyx_int_1, __pyx_v_targetindex, __pyx_v_nameloc};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __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_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_10, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_curID);
        __Pyx_GIVEREF(__pyx_v_curID);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_10, __pyx_v_curID);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_10, __pyx_int_1);
        __Pyx_INCREF(__pyx_v_targetindex);
        __Pyx_GIVEREF(__pyx_v_targetindex);
        PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_10, __pyx_v_targetindex);
        __Pyx_INCREF(__pyx_v_nameloc);
        __Pyx_GIVEREF(__pyx_v_nameloc);
        PyTuple_SET_ITEM(__pyx_t_2, 4+__pyx_t_10, __pyx_v_nameloc);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":321
 *             else:
 *                 cc = min(cc, self.hidden)
 *             for targetindex in range(cc):             # <<<<<<<<<<<<<<
 *                 nameloc = "%s-H%d"% (name, targetindex)
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 */
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":310
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 *         for name in stickerlist:             # <<<<<<<<<<<<<<
 *             # pour toutes les tiquettes supplmentaires
 *             curID += 1
 */
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":325
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 *         if not self.singlelayer:             # <<<<<<<<<<<<<<
 *             # commexion de la deuxieme couche  la premiere
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":327
 *         if not self.singlelayer:
 *             # commexion de la deuxieme couche  la premiere
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)             # <<<<<<<<<<<<<<
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(3, withBias=1, named=1)
 */
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connectLayer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_withBias, __pyx_int_1) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_named, __pyx_int_1) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_fixed1, __pyx_t_1) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__15, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":329
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(3, withBias=1, named=1)             # <<<<<<<<<<<<<<
 *         else:
 *             self.connectLayer(1, -1, named=1)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connectLayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_withBias, __pyx_int_1) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_named, __pyx_int_1) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":325
 *                 self.addLink(0, curID, 1, targetindex, nameloc)
 * 
 *         if not self.singlelayer:             # <<<<<<<<<<<<<<
 *             # commexion de la deuxieme couche  la premiere
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)
 */
    goto __pyx_L186;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":331
 *             self.connectLayer(3, withBias=1, named=1)
 *         else:
 *             self.connectLayer(1, -1, named=1)             # <<<<<<<<<<<<<<
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(2, withBias=1, named=1)
 */
  /*else*/ {
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connectLayer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_named, __pyx_int_1) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__17, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":333
 *             self.connectLayer(1, -1, named=1)
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(2, withBias=1, named=1)             # <<<<<<<<<<<<<<
 * 
 *         self.driver.mainModel.synapseAlign()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connectLayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_withBias, __pyx_int_1) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_named, __pyx_int_1) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  __pyx_L186:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":335
 *             self.connectLayer(2, withBias=1, named=1)
 * 
 *         self.driver.mainModel.synapseAlign()             # <<<<<<<<<<<<<<
 *         # keep memory of the original "hidden"
 *         self.driver.mainModel.hidden = hidden
 */
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_synapseAlign); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 335, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":337
 *         self.driver.mainModel.synapseAlign()
 *         # keep memory of the original "hidden"
 *         self.driver.mainModel.hidden = hidden             # <<<<<<<<<<<<<<
 *         self.driver.isLinear = (hidden == 0)
 * 
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_13, __pyx_n_s_hidden, __pyx_v_hidden) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":338
 *         # keep memory of the original "hidden"
 *         self.driver.mainModel.hidden = hidden
 *         self.driver.isLinear = (hidden == 0)             # <<<<<<<<<<<<<<
 * 
 *         #=======================================================================
 */
  __pyx_t_13 = __Pyx_PyInt_EqObjC(__pyx_v_hidden, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_14, __pyx_n_s_isLinear, __pyx_t_13) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":346
 *         #    self.addComment('parameter(%d)="%s"'% (i, val))
 *         #=======================================================================
 *         self.driver.modelName = "Unit"             # <<<<<<<<<<<<<<
 * 
 *         # le rseau ebauche est mis en mmoire ici
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_14, __pyx_n_s_modelName, __pyx_n_u_Unit) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":349
 * 
 *         # le rseau ebauche est mis en mmoire ici
 *         self._ebauche = dumps(self.driver.mainModel)             # <<<<<<<<<<<<<<
 * 
 *         for key, value in connect.items():
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_dumps); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_14);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_13)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_2, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ebauche, __pyx_t_14) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":351
 *         self._ebauche = dumps(self.driver.mainModel)
 * 
 *         for key, value in connect.items():             # <<<<<<<<<<<<<<
 *             if (value <= hidden) and (value != -1):
 *                 self.driver.addComment("connect['%s']=%d"%(key, value))
 */
  __pyx_t_9 = 0;
  if (unlikely(__pyx_v_connect == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 351, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_connect, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_10)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __pyx_t_14 = __pyx_t_13;
  __pyx_t_13 = 0;
  while (1) {
    __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_14, __pyx_t_6, &__pyx_t_9, &__pyx_t_13, &__pyx_t_2, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_11 == 0)) break;
    if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":352
 * 
 *         for key, value in connect.items():
 *             if (value <= hidden) and (value != -1):             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("connect['%s']=%d"%(key, value))
 *         return
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_v_hidden, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L190_bool_binop_done;
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_4;
    __pyx_L190_bool_binop_done:;
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":353
 *         for key, value in connect.items():
 *             if (value <= hidden) and (value != -1):
 *                 self.driver.addComment("connect['%s']=%d"%(key, value))             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_addComment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_22 = 0;
      __pyx_t_23 = 127;
      __Pyx_INCREF(__pyx_kp_u_connect_2);
      __pyx_t_22 += 9;
      __Pyx_GIVEREF(__pyx_kp_u_connect_2);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_kp_u_connect_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_22 += 3;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u__19);
      __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_value, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_23 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_23) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_23;
      __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, __pyx_t_22, __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_13) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __pyx_t_13 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":352
 * 
 *         for key, value in connect.items():
 *             if (value <= hidden) and (value != -1):             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("connect['%s']=%d"%(key, value))
 *         return
 */
    }
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":354
 *             if (value <= hidden) and (value != -1):
 *                 self.driver.addComment("connect['%s']=%d"%(key, value))
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":83
 *         """
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,             # <<<<<<<<<<<<<<
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_actionC1);
  __Pyx_XDECREF(__pyx_v_afunc);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_atom);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_inlist);
  __Pyx_XDECREF(__pyx_v_H1layerdata);
  __Pyx_XDECREF(__pyx_v_H2layerdata);
  __Pyx_XDECREF(__pyx_v_layerlist);
  __Pyx_XDECREF(__pyx_v_outfunc);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_curID);
  __Pyx_XDECREF(__pyx_v_cc);
  __Pyx_XDECREF(__pyx_v_targetindex);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_iIso);
  __Pyx_XDECREF(__pyx_v_iChi);
  __Pyx_XDECREF(__pyx_v_iDegre);
  __Pyx_XDECREF(__pyx_v_nameloc);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_atoms);
  __Pyx_XDECREF(__pyx_v_maxgrade);
  __Pyx_XDECREF(__pyx_v_isomer);
  __Pyx_XDECREF(__pyx_v_chirality);
  __Pyx_XDECREF(__pyx_v_chargelist);
  __Pyx_XDECREF(__pyx_v_stickerlist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/graphmachineworkshop.py":356
 *         return
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop             # <<<<<<<<<<<<<<
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_3finishmodel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_3finishmodel = {"finishmodel", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_3finishmodel, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_3finishmodel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_keepend = 0;
  PyObject *__pyx_v_compactness = 0;
  CYTHON_UNUSED PyObject *__pyx_v_params = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finishmodel (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keepend,&__pyx_n_s_compactness,&__pyx_n_s_params,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_3));
    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_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_keepend);
          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_compactness);
          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_params);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "finishmodel") < 0)) __PYX_ERR(0, 356, __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_self = values[0];
    __pyx_v_keepend = values[1];
    __pyx_v_compactness = values[2];
    __pyx_v_params = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("finishmodel", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 356, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.finishmodel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_2finishmodel(__pyx_self, __pyx_v_self, __pyx_v_keepend, __pyx_v_compactness, __pyx_v_params);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_2finishmodel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keepend, PyObject *__pyx_v_compactness, CYTHON_UNUSED PyObject *__pyx_v_params) {
  PyObject *__pyx_v_ni = NULL;
  PyObject *__pyx_v_tokill = NULL;
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_cumul = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_i = 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;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("finishmodel", 0);
  __Pyx_INCREF(__pyx_v_compactness);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":357
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop
 *         ni = self.driver.info[C.INPUT_COUNT]             # <<<<<<<<<<<<<<
 *         if (keepend < ni):
 *             # on commence par supprimer les entres inutiles
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ni = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":358
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):             # <<<<<<<<<<<<<<
 *             # on commence par supprimer les entres inutiles
 *             #if newfactory:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_keepend, __pyx_v_ni, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":361
 *             # on commence par supprimer les entres inutiles
 *             #if newfactory:
 *             tokill = [i for i in range(ni-1, keepend-1, -1) if not self.driver.info[i, C.II_P_SYN_CHILDREN]]             # <<<<<<<<<<<<<<
 *             #else:
 *             #    tokill = [i for i in range(ni-1, keepend-1, -1) if not self.driver.info[i+1, C.II_P_SYN_CHILDREN]]
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_ni, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_keepend, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_neg_1);
      __pyx_t_3 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          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_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L6_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L6_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_7(__pyx_t_5);
          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, 361, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_i, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_II_P_SYN_CHILDREN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_8genexpr4__pyx_v_i);
        __Pyx_GIVEREF(__pyx_8genexpr4__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_8genexpr4__pyx_v_i);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 361, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = ((!__pyx_t_4) != 0);
        if (__pyx_t_9) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_i))) __PYX_ERR(0, 361, __pyx_L6_error)
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_i); __pyx_8genexpr4__pyx_v_i = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_i); __pyx_8genexpr4__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_v_tokill = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":364
 *             #else:
 *             #    tokill = [i for i in range(ni-1, keepend-1, -1) if not self.driver.info[i+1, C.II_P_SYN_CHILDREN]]
 *             for i in tokill:             # <<<<<<<<<<<<<<
 *                 res = self.deleteNode(layerindex=0, nodeindex=i, style=C.PS_KEEP_LINKS)
 * 
 */
    __pyx_t_1 = __pyx_v_tokill; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_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, 364, __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, 364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":365
 *             #    tokill = [i for i in range(ni-1, keepend-1, -1) if not self.driver.info[i+1, C.II_P_SYN_CHILDREN]]
 *             for i in tokill:
 *                 res = self.deleteNode(layerindex=0, nodeindex=i, style=C.PS_KEEP_LINKS)             # <<<<<<<<<<<<<<
 * 
 *         if (keepend < ni) and compactness:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_deleteNode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_layerindex, __pyx_int_0) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_nodeindex, __pyx_v_i) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PS_KEEP_LINKS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_style, __pyx_t_3) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":364
 *             #else:
 *             #    tokill = [i for i in range(ni-1, keepend-1, -1) if not self.driver.info[i+1, C.II_P_SYN_CHILDREN]]
 *             for i in tokill:             # <<<<<<<<<<<<<<
 *                 res = self.deleteNode(layerindex=0, nodeindex=i, style=C.PS_KEEP_LINKS)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":358
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):             # <<<<<<<<<<<<<<
 *             # on commence par supprimer les entres inutiles
 *             #if newfactory:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":367
 *                 res = self.deleteNode(layerindex=0, nodeindex=i, style=C.PS_KEEP_LINKS)
 * 
 *         if (keepend < ni) and compactness:             # <<<<<<<<<<<<<<
 * 
 *             if (compactness == 2):  # newfactory and
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_keepend, __pyx_v_ni, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_9 = __pyx_t_4;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_compactness); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 367, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_4;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_9) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":369
 *         if (keepend < ni) and compactness:
 * 
 *             if (compactness == 2):  # newfactory and             # <<<<<<<<<<<<<<
 *                 compactness = 3
 *             # il y a compactage
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":370
 * 
 *             if (compactness == 2):  # newfactory and
 *                 compactness = 3             # <<<<<<<<<<<<<<
 *             # il y a compactage
 *             if compactness == 1:
 */
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_DECREF_SET(__pyx_v_compactness, __pyx_int_3);

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":369
 *         if (keepend < ni) and compactness:
 * 
 *             if (compactness == 2):  # newfactory and             # <<<<<<<<<<<<<<
 *                 compactness = 3
 *             # il y a compactage
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":372
 *                 compactness = 3
 *             # il y a compactage
 *             if compactness == 1:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":373
 *             # il y a compactage
 *             if compactness == 1:
 *                 self.driver.addComment("constant inputs integrated in layer 1")             # <<<<<<<<<<<<<<
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_addComment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __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/chem_gm/core/graphmachineworkshop.py":372
 *                 compactness = 3
 *             # il y a compactage
 *             if compactness == 1:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:
 */
      goto __pyx_L17;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":374
 *             if compactness == 1:
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":375
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")             # <<<<<<<<<<<<<<
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_addComment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __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/chem_gm/core/graphmachineworkshop.py":374
 *             if compactness == 1:
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:
 */
      goto __pyx_L17;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":376
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in bias")
 *             if keepend:
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":377
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")             # <<<<<<<<<<<<<<
 *             if keepend:
 *                 self.driver.addComment("keepend=%d"% keepend)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_addComment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __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/chem_gm/core/graphmachineworkshop.py":376
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("constant inputs integrated in bias")
 *             if keepend:
 */
    }
    __pyx_L17:;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":378
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")
 *             if keepend:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("keepend=%d"% keepend)
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_keepend); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":379
 *                 self.driver.addComment("constant inputs integrated in bias")
 *             if keepend:
 *                 self.driver.addComment("keepend=%d"% keepend)             # <<<<<<<<<<<<<<
 * 
 *             if compactness == 1:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addComment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_keepend_d, __pyx_v_keepend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __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_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":378
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")
 *             if keepend:             # <<<<<<<<<<<<<<
 *                 self.driver.addComment("keepend=%d"% keepend)
 * 
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":381
 *                 self.driver.addComment("keepend=%d"% keepend)
 * 
 *             if compactness == 1:             # <<<<<<<<<<<<<<
 *             # cration d'une couche vide en 1. On y dplace les entres fixes, et on les connecte au biais
 *                 self.addLayer("", 1)
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":383
 *             if compactness == 1:
 *             # cration d'une couche vide en 1. On y dplace les entres fixes, et on les connecte au biais
 *                 self.addLayer("", 1)             # <<<<<<<<<<<<<<
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":384
 *             # cration d'une couche vide en 1. On y dplace les entres fixes, et on les connecte au biais
 *                 self.addLayer("", 1)
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:             # <<<<<<<<<<<<<<
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 *                     self.moveNode(0, n, 1, 0, style=C.PS_KEEP_LINKS)
 */
      while (1) {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_keepend, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_9) break;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":385
 *                 self.addLayer("", 1)
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1             # <<<<<<<<<<<<<<
 *                     self.moveNode(0, n, 1, 0, style=C.PS_KEEP_LINKS)
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_keepend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":386
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 *                     self.moveNode(0, n, 1, 0, style=C.PS_KEEP_LINKS)             # <<<<<<<<<<<<<<
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_moveNode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_n);
        __Pyx_GIVEREF(__pyx_v_n);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_1);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
        __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PS_KEEP_LINKS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_style, __pyx_t_5) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":387
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 *                     self.moveNode(0, n, 1, 0, style=C.PS_KEEP_LINKS)
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #             # <<<<<<<<<<<<<<
 * 
 *             elif compactness == 2:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LS_FIXE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LS_TELQUEL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_style, __pyx_t_1) < 0) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_value, __pyx_float_1_0) < 0) __PYX_ERR(0, 387, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__24, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":381
 *                 self.driver.addComment("keepend=%d"% keepend)
 * 
 *             if compactness == 1:             # <<<<<<<<<<<<<<
 *             # cration d'une couche vide en 1. On y dplace les entres fixes, et on les connecte au biais
 *                 self.addLayer("", 1)
 */
      goto __pyx_L19;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":389
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #
 * 
 *             elif compactness == 2:             # <<<<<<<<<<<<<<
 *             # les entres fixes sont dplaces dans la couche constante (-1)
 *             # uniquement pour models ndk
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":392
 *             # les entres fixes sont dplaces dans la couche constante (-1)
 *             # uniquement pour models ndk
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:             # <<<<<<<<<<<<<<
 *                     self.setNodeValue(0, 0, value=1.0)
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #
 */
      while (1) {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __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_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_keepend, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!__pyx_t_9) break;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":393
 *             # uniquement pour models ndk
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     self.setNodeValue(0, 0, value=1.0)             # <<<<<<<<<<<<<<
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #
 * 
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setNodeValue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, __pyx_float_1_0) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__25, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":394
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     self.setNodeValue(0, 0, value=1.0)
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #             # <<<<<<<<<<<<<<
 * 
 *             elif compactness == 3:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_moveNode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PS_KEEP_LINKS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_style, __pyx_t_3) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":389
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #
 * 
 *             elif compactness == 2:             # <<<<<<<<<<<<<<
 *             # les entres fixes sont dplaces dans la couche constante (-1)
 *             # uniquement pour models ndk
 */
      goto __pyx_L19;
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":396
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #
 * 
 *             elif compactness == 3:             # <<<<<<<<<<<<<<
 *             # les entres constantes sont supprimes aprs que leurs synapse aient t reprises par la biais
 *                 cumul = 0
 */
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_compactness, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":398
 *             elif compactness == 3:
 *             # les entres constantes sont supprimes aprs que leurs synapse aient t reprises par la biais
 *                 cumul = 0             # <<<<<<<<<<<<<<
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_v_cumul = __pyx_int_0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":399
 *             # les entres constantes sont supprimes aprs que leurs synapse aient t reprises par la biais
 *                 cumul = 0
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:             # <<<<<<<<<<<<<<
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)
 *                     self.deleteNode(0, 0)
 */
      while (1) {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_keepend, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!__pyx_t_9) break;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":400
 *                 cumul = 0
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)             # <<<<<<<<<<<<<<
 *                     self.deleteNode(0, 0)
 *                     cumul += 1
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mergeNode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_originlayer, __pyx_int_neg_1) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_originindex, __pyx_int_0) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_targetlayer, __pyx_int_0) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_targetindex, __pyx_int_0) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_outputbool, __pyx_int_1) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":401
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)
 *                     self.deleteNode(0, 0)             # <<<<<<<<<<<<<<
 *                     cumul += 1
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_deleteNode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __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/chem_gm/core/graphmachineworkshop.py":402
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)
 *                     self.deleteNode(0, 0)
 *                     cumul += 1             # <<<<<<<<<<<<<<
 * 
 *         self.compactModel(C.CM_PARAMETERS)
 */
        __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_cumul, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_cumul, __pyx_t_3);
        __pyx_t_3 = 0;
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":396
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #
 * 
 *             elif compactness == 3:             # <<<<<<<<<<<<<<
 *             # les entres constantes sont supprimes aprs que leurs synapse aient t reprises par la biais
 *                 cumul = 0
 */
    }
    __pyx_L19:;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":367
 *                 res = self.deleteNode(layerindex=0, nodeindex=i, style=C.PS_KEEP_LINKS)
 * 
 *         if (keepend < ni) and compactness:             # <<<<<<<<<<<<<<
 * 
 *             if (compactness == 2):  # newfactory and
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":404
 *                     cumul += 1
 * 
 *         self.compactModel(C.CM_PARAMETERS)             # <<<<<<<<<<<<<<
 *         self.driver.mainModel.bias.value = 1
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compactModel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CM_PARAMETERS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __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_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":405
 * 
 *         self.compactModel(C.CM_PARAMETERS)
 *         self.driver.mainModel.bias.value = 1             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------------
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bias); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_value, __pyx_int_1) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":356
 *         return
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop             # <<<<<<<<<<<<<<
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):
 */

  /* 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_8);
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.finishmodel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ni);
  __Pyx_XDECREF(__pyx_v_tokill);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_cumul);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_compactness);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/graphmachineworkshop.py":408
 * 
 * #----------------------------------------------------------------------------
 *     def addtokenrow(self, lst, stickerlist, mergeisochi=True):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *     Permet d'intgrer une nouvelle liste de jetons.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_5addtokenrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_4addtokenrow[] = "        \n    Permet d'int\303\251grer une nouvelle liste de jetons.\n    lst est la liste de jetons \303\240 int\303\251grer.\n    L'int\303\251gration d'un jeton suit le processus suivant :\n        - cr\303\251ation d'un mod\303\250le \303\251bauche \303\240 partir de sa cha\303\256ne descriptive\n        - sp\303\251cialisation du mod\303\250le d'atome avec les informations du jeton. les jetons ont la sortie coup\303\251e, sauf le premier.\n        - si en d\303\251but de liste, cr\303\251ation de deux couches vides dans le mod\303\250le principal\n        - insertion du mod\303\250le atomique en couche 1 et 2\n        - connexion du bloc ins\303\251r\303\251 avec les pr\303\251c\303\251dents en foncton des liaisons.";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_5addtokenrow = {"addtokenrow", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_5addtokenrow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_4addtokenrow};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_5addtokenrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lst = 0;
  PyObject *__pyx_v_stickerlist = 0;
  PyObject *__pyx_v_mergeisochi = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addtokenrow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lst,&__pyx_n_s_stickerlist,&__pyx_n_s_mergeisochi,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((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  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_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_lst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("addtokenrow", 0, 3, 4, 1); __PYX_ERR(0, 408, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stickerlist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("addtokenrow", 0, 3, 4, 2); __PYX_ERR(0, 408, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mergeisochi);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addtokenrow") < 0)) __PYX_ERR(0, 408, __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);
        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_self = values[0];
    __pyx_v_lst = values[1];
    __pyx_v_stickerlist = values[2];
    __pyx_v_mergeisochi = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addtokenrow", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 408, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.addtokenrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_4addtokenrow(__pyx_self, __pyx_v_self, __pyx_v_lst, __pyx_v_stickerlist, __pyx_v_mergeisochi);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_4addtokenrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lst, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_mergeisochi) {
  CYTHON_UNUSED PyObject *__pyx_v_ni = NULL;
  PyObject *__pyx_v_layerstep = NULL;
  PyObject *__pyx_v_tokt = NULL;
  PyObject *__pyx_v_layershift = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_curmodel = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_originlayer = NULL;
  PyObject *__pyx_v_targetlayer = NULL;
  PyObject *__pyx_v_hiddenindex = NULL;
  PyObject *__pyx_v_originindex = NULL;
  PyObject *__pyx_v_targetindex = 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;
  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 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  __Pyx_RefNannySetupContext("addtokenrow", 0);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":418
 *         - insertion du modle atomique en couche 1 et 2
 *         - connexion du bloc insr avec les prcdents en foncton des liaisons."""
 *         ni = self.driver.info[C.INPUT_COUNT]             # <<<<<<<<<<<<<<
 *         layerstep = 1 if self.singlelayer else 2
 *         for tokt in self.toktable:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INPUT_COUNT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ni = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":419
 *         - connexion du bloc insr avec les prcdents en foncton des liaisons."""
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         layerstep = 1 if self.singlelayer else 2             # <<<<<<<<<<<<<<
 *         for tokt in self.toktable:
 *             tokt.firstlayer += layerstep
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_int_1);
    __pyx_t_1 = __pyx_int_1;
  } else {
    __Pyx_INCREF(__pyx_int_2);
    __pyx_t_1 = __pyx_int_2;
  }
  __pyx_v_layerstep = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":420
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         layerstep = 1 if self.singlelayer else 2
 *         for tokt in self.toktable:             # <<<<<<<<<<<<<<
 *             tokt.firstlayer += layerstep
 *             tokt.lastlayer += layerstep
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toktable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  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, 420, __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, 420, __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, 420, __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, 420, __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, 420, __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, 420, __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, 420, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tokt, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":421
 *         layerstep = 1 if self.singlelayer else 2
 *         for tokt in self.toktable:
 *             tokt.firstlayer += layerstep             # <<<<<<<<<<<<<<
 *             tokt.lastlayer += layerstep
 *         # cette ligne implique que les couches de jetons sont introduites dans l'ordre,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tokt, __pyx_n_s_firstlayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_layerstep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tokt, __pyx_n_s_firstlayer, __pyx_t_2) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":422
 *         for tokt in self.toktable:
 *             tokt.firstlayer += layerstep
 *             tokt.lastlayer += layerstep             # <<<<<<<<<<<<<<
 *         # cette ligne implique que les couches de jetons sont introduites dans l'ordre,
 *         # en commencant pat l'atome central, seul sur sa couche,
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tokt, __pyx_n_s_lastlayer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_layerstep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tokt, __pyx_n_s_lastlayer, __pyx_t_1) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":420
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         layerstep = 1 if self.singlelayer else 2
 *         for tokt in self.toktable:             # <<<<<<<<<<<<<<
 *             tokt.firstlayer += layerstep
 *             tokt.lastlayer += layerstep
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":426
 *         # en commencant pat l'atome central, seul sur sa couche,
 *         # et en suivant par les couches successives de distance croissante avec le central
 *         layershift = -layerstep             # <<<<<<<<<<<<<<
 *         for i, tok in enumerate(lst):
 *             # pour chacun des jetons de la liste prsente
 */
  __pyx_t_3 = PyNumber_Negative(__pyx_v_layerstep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_layershift = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":427
 *         # et en suivant par les couches successives de distance croissante avec le central
 *         layershift = -layerstep
 *         for i, tok in enumerate(lst):             # <<<<<<<<<<<<<<
 *             # pour chacun des jetons de la liste prsente
 *             curmodel = self._specialisermodele(tok, self.singlelayer, stickerlist, mergeisochi)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__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, 427, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":429
 *         for i, tok in enumerate(lst):
 *             # pour chacun des jetons de la liste prsente
 *             curmodel = self._specialisermodele(tok, self.singlelayer, stickerlist, mergeisochi)             # <<<<<<<<<<<<<<
 *             tok.firstlayer = 1
 *             tok.lastlayer = layerstep
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specialisermodele); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_v_tok, __pyx_t_8, __pyx_v_stickerlist, __pyx_v_mergeisochi};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_v_tok, __pyx_t_8, __pyx_v_stickerlist, __pyx_v_mergeisochi};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_tok);
      __Pyx_GIVEREF(__pyx_v_tok);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_tok);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __Pyx_INCREF(__pyx_v_stickerlist);
      __Pyx_GIVEREF(__pyx_v_stickerlist);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_stickerlist);
      __Pyx_INCREF(__pyx_v_mergeisochi);
      __Pyx_GIVEREF(__pyx_v_mergeisochi);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_v_mergeisochi);
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_curmodel, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":430
 *             # pour chacun des jetons de la liste prsente
 *             curmodel = self._specialisermodele(tok, self.singlelayer, stickerlist, mergeisochi)
 *             tok.firstlayer = 1             # <<<<<<<<<<<<<<
 *             tok.lastlayer = layerstep
 *             tok.firstnode = i * self.hidden
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_firstlayer, __pyx_int_1) < 0) __PYX_ERR(0, 430, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":431
 *             curmodel = self._specialisermodele(tok, self.singlelayer, stickerlist, mergeisochi)
 *             tok.firstlayer = 1
 *             tok.lastlayer = layerstep             # <<<<<<<<<<<<<<
 *             tok.firstnode = i * self.hidden
 *             if len(self.toktable):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_lastlayer, __pyx_v_layerstep) < 0) __PYX_ERR(0, 431, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":432
 *             tok.firstlayer = 1
 *             tok.lastlayer = layerstep
 *             tok.firstnode = i * self.hidden             # <<<<<<<<<<<<<<
 *             if len(self.toktable):
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyNumber_Multiply(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_firstnode, __pyx_t_7) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":433
 *             tok.lastlayer = layerstep
 *             tok.firstnode = i * self.hidden
 *             if len(self.toktable):             # <<<<<<<<<<<<<<
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)
 *                 curmodel.driver.__del__()
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toktable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = (__pyx_t_12 != 0);
    if (__pyx_t_4) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":434
 *             tok.firstnode = i * self.hidden
 *             if len(self.toktable):
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)             # <<<<<<<<<<<<<<
 *                 curmodel.driver.__del__()
 *                 curmodel = None
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mergeModel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ninputmerge, __pyx_int_1) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_byname, __pyx_int_1) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sharedsynapses, __pyx_int_1) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nlayershift, __pyx_v_layershift) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":435
 *             if len(self.toktable):
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)
 *                 curmodel.driver.__del__()             # <<<<<<<<<<<<<<
 *                 curmodel = None
 *                 if res:
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_del); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":436
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)
 *                 curmodel.driver.__del__()
 *                 curmodel = None             # <<<<<<<<<<<<<<
 *                 if res:
 *                     raise GMModelError("Error in model merging = %s"% res)
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_curmodel, Py_None);

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":437
 *                 curmodel.driver.__del__()
 *                 curmodel = None
 *                 if res:             # <<<<<<<<<<<<<<
 *                     raise GMModelError("Error in model merging = %s"% res)
 *                 layershift = 0
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
      if (unlikely(__pyx_t_4)) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":438
 *                 curmodel = None
 *                 if res:
 *                     raise GMModelError("Error in model merging = %s"% res)             # <<<<<<<<<<<<<<
 *                 layershift = 0
 * 
 */
        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_GMModelError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_Error_in_model_merging_s, __pyx_v_res); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GOTREF(__pyx_t_8);
            __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, 438, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 438, __pyx_L1_error)

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":437
 *                 curmodel.driver.__del__()
 *                 curmodel = None
 *                 if res:             # <<<<<<<<<<<<<<
 *                     raise GMModelError("Error in model merging = %s"% res)
 *                 layershift = 0
 */
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":439
 *                 if res:
 *                     raise GMModelError("Error in model merging = %s"% res)
 *                 layershift = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_layershift, __pyx_int_0);

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":433
 *             tok.lastlayer = layerstep
 *             tok.firstnode = i * self.hidden
 *             if len(self.toktable):             # <<<<<<<<<<<<<<
 *                 res = self.driver.mergeModel(curmodel.driver, ninputmerge=1, byname=1, sharedsynapses=1, nlayershift=layershift)
 *                 curmodel.driver.__del__()
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":443
 * 
 *             # connexion du nouveau bloc "tok" aux blocs prcdement intgrs, en fonction des liaisons
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):             # <<<<<<<<<<<<<<
 *                 if target in self.toktable:
 *                     originlayer = tok.lastlayer
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_alphagen); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_modelbrkexcluded, Py_True) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__28, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 443, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    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_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 443, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 443, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_13(__pyx_t_11);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 443, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":444
 *             # connexion du nouveau bloc "tok" aux blocs prcdement intgrs, en fonction des liaisons
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):
 *                 if target in self.toktable:             # <<<<<<<<<<<<<<
 *                     originlayer = tok.lastlayer
 *                     targetlayer = target.firstlayer
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toktable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_target, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_14 = (__pyx_t_4 != 0);
      if (__pyx_t_14) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":445
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):
 *                 if target in self.toktable:
 *                     originlayer = tok.lastlayer             # <<<<<<<<<<<<<<
 *                     targetlayer = target.firstlayer
 *                     for hiddenindex in range(self.hidden):
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_lastlayer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 445, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_originlayer, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":446
 *                 if target in self.toktable:
 *                     originlayer = tok.lastlayer
 *                     targetlayer = target.firstlayer             # <<<<<<<<<<<<<<
 *                     for hiddenindex in range(self.hidden):
 *                         originindex = hiddenindex + tok.firstnode
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_firstlayer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_targetlayer, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":447
 *                     originlayer = tok.lastlayer
 *                     targetlayer = target.firstlayer
 *                     for hiddenindex in range(self.hidden):             # <<<<<<<<<<<<<<
 *                         originindex = hiddenindex + tok.firstnode
 *                         targetindex = hiddenindex + target.firstnode
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __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_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 447, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= 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_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              if (__pyx_t_15 >= 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_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_16(__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, 447, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_XDECREF_SET(__pyx_v_hiddenindex, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":448
 *                     targetlayer = target.firstlayer
 *                     for hiddenindex in range(self.hidden):
 *                         originindex = hiddenindex + tok.firstnode             # <<<<<<<<<<<<<<
 *                         targetindex = hiddenindex + target.firstnode
 * 
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_firstnode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = PyNumber_Add(__pyx_v_hiddenindex, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_originindex, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":449
 *                     for hiddenindex in range(self.hidden):
 *                         originindex = hiddenindex + tok.firstnode
 *                         targetindex = hiddenindex + target.firstnode             # <<<<<<<<<<<<<<
 * 
 *                         res = self.addLink(originlayer, originindex, targetlayer, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_firstnode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = PyNumber_Add(__pyx_v_hiddenindex, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF_SET(__pyx_v_targetindex, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":451
 *                         targetindex = hiddenindex + target.firstnode
 * 
 *                         res = self.addLink(originlayer, originindex, targetlayer, targetindex, style=C.LS_FIXE, value=1.0)  # + C.LS_TELQUEL             # <<<<<<<<<<<<<<
 *             # en finale, le jeton est enregistr dans la table de mmoire
 * 
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addLink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_originlayer);
          __Pyx_GIVEREF(__pyx_v_originlayer);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_originlayer);
          __Pyx_INCREF(__pyx_v_originindex);
          __Pyx_GIVEREF(__pyx_v_originindex);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_originindex);
          __Pyx_INCREF(__pyx_v_targetlayer);
          __Pyx_GIVEREF(__pyx_v_targetlayer);
          PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_targetlayer);
          __Pyx_INCREF(__pyx_v_targetindex);
          __Pyx_GIVEREF(__pyx_v_targetindex);
          PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_targetindex);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_LS_FIXE); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_style, __pyx_t_18) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_float_1_0) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __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;
          __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_18);
          __pyx_t_18 = 0;

          /* "metaphor/chem_gm/core/graphmachineworkshop.py":447
 *                     originlayer = tok.lastlayer
 *                     targetlayer = target.firstlayer
 *                     for hiddenindex in range(self.hidden):             # <<<<<<<<<<<<<<
 *                         originindex = hiddenindex + tok.firstnode
 *                         targetindex = hiddenindex + target.firstnode
 */
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":444
 *             # connexion du nouveau bloc "tok" aux blocs prcdement intgrs, en fonction des liaisons
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):
 *                 if target in self.toktable:             # <<<<<<<<<<<<<<
 *                     originlayer = tok.lastlayer
 *                     targetlayer = target.firstlayer
 */
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":443
 * 
 *             # connexion du nouveau bloc "tok" aux blocs prcdement intgrs, en fonction des liaisons
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):             # <<<<<<<<<<<<<<
 *                 if target in self.toktable:
 *                     originlayer = tok.lastlayer
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":454
 *             # en finale, le jeton est enregistr dans la table de mmoire
 * 
 *             self.toktable.append(tok)             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------------
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toktable); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_11, __pyx_v_tok); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 454, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":427
 *         # et en suivant par les couches successives de distance croissante avec le central
 *         layershift = -layerstep
 *         for i, tok in enumerate(lst):             # <<<<<<<<<<<<<<
 *             # pour chacun des jetons de la liste prsente
 *             curmodel = self._specialisermodele(tok, self.singlelayer, stickerlist, mergeisochi)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":408
 * 
 * #----------------------------------------------------------------------------
 *     def addtokenrow(self, lst, stickerlist, mergeisochi=True):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *     Permet d'intgrer une nouvelle liste de jetons.
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.addtokenrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ni);
  __Pyx_XDECREF(__pyx_v_layerstep);
  __Pyx_XDECREF(__pyx_v_tokt);
  __Pyx_XDECREF(__pyx_v_layershift);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_curmodel);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_originlayer);
  __Pyx_XDECREF(__pyx_v_targetlayer);
  __Pyx_XDECREF(__pyx_v_hiddenindex);
  __Pyx_XDECREF(__pyx_v_originindex);
  __Pyx_XDECREF(__pyx_v_targetindex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/graphmachineworkshop.py":457
 * 
 * #----------------------------------------------------------------------------
 *     def removeorphans(self):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Traitement des noeuds orphelins.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_7removeorphans(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_6removeorphans[] = "\n        Traitement des noeuds orphelins.\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_7removeorphans = {"removeorphans", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_7removeorphans, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_6removeorphans};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_7removeorphans(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("removeorphans (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_6removeorphans(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_6removeorphans(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_nlayer = NULL;
  long __pyx_v_step;
  PyObject *__pyx_v_ilayer = NULL;
  PyObject *__pyx_v_ll = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_jj = NULL;
  PyObject *__pyx_v_parents = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("removeorphans", 0);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":462
 *         """
 *         # traitement des orphelins
 *         nlayer = self.driver.info[C.LAYER_COUNT]             # <<<<<<<<<<<<<<
 *         step = 1 if self.singlelayer else 2
 *         for ilayer in range(1, nlayer-1, step):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LAYER_COUNT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nlayer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":463
 *         # traitement des orphelins
 *         nlayer = self.driver.info[C.LAYER_COUNT]
 *         step = 1 if self.singlelayer else 2             # <<<<<<<<<<<<<<
 *         for ilayer in range(1, nlayer-1, step):
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_singlelayer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __pyx_t_4 = 1;
  } else {
    __pyx_t_4 = 2;
  }
  __pyx_v_step = __pyx_t_4;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":464
 *         nlayer = self.driver.info[C.LAYER_COUNT]
 *         step = 1 if self.singlelayer else 2
 *         for ilayer in range(1, nlayer-1, step):             # <<<<<<<<<<<<<<
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 *             for j in range(ll):
 */
  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_nlayer, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __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, 464, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_2);
      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, 464, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_ilayer, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":465
 *         step = 1 if self.singlelayer else 2
 *         for ilayer in range(1, nlayer-1, step):
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]             # <<<<<<<<<<<<<<
 *             for j in range(ll):
 *                 jj = ll - 1 - j
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_II_P_LAYER_LENGTH); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_ilayer);
    __Pyx_GIVEREF(__pyx_v_ilayer);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ilayer);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ll, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":466
 *         for ilayer in range(1, nlayer-1, step):
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 *             for j in range(ll):             # <<<<<<<<<<<<<<
 *                 jj = ll - 1 - j
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_ll); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 466, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_3);
        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, 466, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":467
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 *             for j in range(ll):
 *                 jj = ll - 1 - j             # <<<<<<<<<<<<<<
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 *                 if not parents and not symbolFromNodeName(self.driver.nodeNames[ilayer, jj]) in ['c', 'C']:
 */
      __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_v_ll, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyNumber_Subtract(__pyx_t_8, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":468
 *             for j in range(ll):
 *                 jj = ll - 1 - j
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]             # <<<<<<<<<<<<<<
 *                 if not parents and not symbolFromNodeName(self.driver.nodeNames[ilayer, jj]) in ['c', 'C']:
 *                     self.deleteNode(ilayer, jj, style=C.PS_KEEP_LINKS)  #
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_II_P_SYN_PARENTS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_ilayer);
      __Pyx_GIVEREF(__pyx_v_ilayer);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ilayer);
      __Pyx_INCREF(__pyx_v_jj);
      __Pyx_GIVEREF(__pyx_v_jj);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_jj);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_parents, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":469
 *                 jj = ll - 1 - j
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 *                 if not parents and not symbolFromNodeName(self.driver.nodeNames[ilayer, jj]) in ['c', 'C']:             # <<<<<<<<<<<<<<
 *                     self.deleteNode(ilayer, jj, style=C.PS_KEEP_LINKS)  #
 * 
 */
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_parents); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
      __pyx_t_13 = ((!__pyx_t_12) != 0);
      if (__pyx_t_13) {
      } else {
        __pyx_t_5 = __pyx_t_13;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_symbolFromNodeName); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeNames); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_ilayer);
      __Pyx_GIVEREF(__pyx_v_ilayer);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ilayer);
      __Pyx_INCREF(__pyx_v_jj);
      __Pyx_GIVEREF(__pyx_v_jj);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_jj);
      __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_14, __pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 469, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_15};
          __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 469, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_15};
          __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 469, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 469, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL;
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 469, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_n_u_c, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_n_u_C, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
      __pyx_t_13 = __pyx_t_12;
      __pyx_L10_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = (__pyx_t_13 != 0);
      __pyx_t_5 = __pyx_t_12;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_5) {

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":470
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 *                 if not parents and not symbolFromNodeName(self.driver.nodeNames[ilayer, jj]) in ['c', 'C']:
 *                     self.deleteNode(ilayer, jj, style=C.PS_KEEP_LINKS)  #             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------------
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_deleteNode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_ilayer);
        __Pyx_GIVEREF(__pyx_v_ilayer);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ilayer);
        __Pyx_INCREF(__pyx_v_jj);
        __Pyx_GIVEREF(__pyx_v_jj);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_jj);
        __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_PS_KEEP_LINKS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_style, __pyx_t_8) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/graphmachineworkshop.py":469
 *                 jj = ll - 1 - j
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 *                 if not parents and not symbolFromNodeName(self.driver.nodeNames[ilayer, jj]) in ['c', 'C']:             # <<<<<<<<<<<<<<
 *                     self.deleteNode(ilayer, jj, style=C.PS_KEEP_LINKS)  #
 * 
 */
      }

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":466
 *         for ilayer in range(1, nlayer-1, step):
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 *             for j in range(ll):             # <<<<<<<<<<<<<<
 *                 jj = ll - 1 - j
 *                 parents = self.driver.info[ilayer, jj, C.II_P_SYN_PARENTS]
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":464
 *         nlayer = self.driver.info[C.LAYER_COUNT]
 *         step = 1 if self.singlelayer else 2
 *         for ilayer in range(1, nlayer-1, step):             # <<<<<<<<<<<<<<
 *             ll = self.driver.info[ilayer, C.II_P_LAYER_LENGTH]
 *             for j in range(ll):
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":457
 * 
 * #----------------------------------------------------------------------------
 *     def removeorphans(self):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Traitement des noeuds orphelins.
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop.removeorphans", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nlayer);
  __Pyx_XDECREF(__pyx_v_ilayer);
  __Pyx_XDECREF(__pyx_v_ll);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_jj);
  __Pyx_XDECREF(__pyx_v_parents);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/graphmachineworkshop.py":473
 * 
 * #----------------------------------------------------------------------------
 *     def _specialisermodele(self, token, lin=False, stickerlist=[], mergeisochi=True):   # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Spcialisation d'un modle bauche complet, en fonction du contenu du jeton "token" de type SmiToken.
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_2__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, 473, __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_stickerlist);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_stickerlist);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_stickerlist);
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_True));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __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.chem_gm.core.graphmachineworkshop.__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_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_9_specialisermodele(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_8_specialisermodele[] = "\n        Sp\303\251cialisation d'un mod\303\250le \303\251bauche complet, en fonction du contenu du jeton \"token\" de type SmiToken.\n        \"token\" est le jeton \303\240 copier.\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_9_specialisermodele = {"_specialisermodele", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_9_specialisermodele, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_8_specialisermodele};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_9_specialisermodele(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_token = 0;
  PyObject *__pyx_v_lin = 0;
  PyObject *__pyx_v_stickerlist = 0;
  PyObject *__pyx_v_mergeisochi = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_specialisermodele (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_token,&__pyx_n_s_lin,&__pyx_n_s_stickerlist,&__pyx_n_s_mergeisochi,0};
    PyObject* values[5] = {0,0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = __pyx_dynamic_args->__pyx_arg_stickerlist;
    values[4] = ((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  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_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_token)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_specialisermodele", 0, 2, 5, 1); __PYX_ERR(0, 473, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lin);
          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_stickerlist);
          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_mergeisochi);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_specialisermodele") < 0)) __PYX_ERR(0, 473, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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_self = values[0];
    __pyx_v_token = values[1];
    __pyx_v_lin = values[2];
    __pyx_v_stickerlist = values[3];
    __pyx_v_mergeisochi = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_specialisermodele", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 473, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop._specialisermodele", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_8_specialisermodele(__pyx_self, __pyx_v_self, __pyx_v_token, __pyx_v_lin, __pyx_v_stickerlist, __pyx_v_mergeisochi);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_8_specialisermodele(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_token, PyObject *__pyx_v_lin, PyObject *__pyx_v_stickerlist, PyObject *__pyx_v_mergeisochi) {
  int __pyx_v_cuthead;
  PyObject *__pyx_v_curmodel = NULL;
  PyObject *__pyx_v_model = NULL;
  PyObject *__pyx_v_lc = NULL;
  PyObject *__pyx_v_nbroken = NULL;
  PyObject *__pyx_v_suffix = NULL;
  PyObject *__pyx_v_st = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_ll = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_node = NULL;
  PyObject *__pyx_v_pertinent = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_impertinent = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_UCS4 __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("_specialisermodele", 0);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":483
 *         # s'il n'y a pas encore de jetons dans la liste, le modle courant est self,
 *         # sinon on en cre un nouveau  partir de l'bauche
 *         if len(self.toktable):             # <<<<<<<<<<<<<<
 *             cuthead = True
 *             # s'il ya dj des jetons dans la liste, il faut couper la tte des suivants
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toktable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":484
 *         # sinon on en cre un nouveau  partir de l'bauche
 *         if len(self.toktable):
 *             cuthead = True             # <<<<<<<<<<<<<<
 *             # s'il ya dj des jetons dans la liste, il faut couper la tte des suivants
 *             curmodel = modelWorkshop(factory(self._ebauche))
 */
    __pyx_v_cuthead = 1;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":486
 *             cuthead = True
 *             # s'il ya dj des jetons dans la liste, il faut couper la tte des suivants
 *             curmodel = modelWorkshop(factory(self._ebauche))             # <<<<<<<<<<<<<<
 *         else:
 *             cuthead = False
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_modelWorkshop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_factory); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ebauche); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __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_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __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_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __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, 486, __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_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_curmodel = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":483
 *         # s'il n'y a pas encore de jetons dans la liste, le modle courant est self,
 *         # sinon on en cre un nouveau  partir de l'bauche
 *         if len(self.toktable):             # <<<<<<<<<<<<<<
 *             cuthead = True
 *             # s'il ya dj des jetons dans la liste, il faut couper la tte des suivants
 */
    goto __pyx_L3;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":488
 *             curmodel = modelWorkshop(factory(self._ebauche))
 *         else:
 *             cuthead = False             # <<<<<<<<<<<<<<
 *             curmodel = self
 *             if lin and (self.hidden == 1):
 */
  /*else*/ {
    __pyx_v_cuthead = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":489
 *         else:
 *             cuthead = False
 *             curmodel = self             # <<<<<<<<<<<<<<
 *             if lin and (self.hidden == 1):
 *             # si le modele est lineaire, le lien vers la tte est rendu fixe
 */
    __Pyx_INCREF(__pyx_v_self);
    __pyx_v_curmodel = __pyx_v_self;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":490
 *             cuthead = False
 *             curmodel = self
 *             if lin and (self.hidden == 1):             # <<<<<<<<<<<<<<
 *             # si le modele est lineaire, le lien vers la tte est rendu fixe
 *                 model = self.driver.mainModel
 */
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_lin); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
    if (__pyx_t_10) {
    } else {
      __pyx_t_3 = __pyx_t_10;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_10;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":492
 *             if lin and (self.hidden == 1):
 *             # si le modele est lineaire, le lien vers la tte est rendu fixe
 *                 model = self.driver.mainModel             # <<<<<<<<<<<<<<
 *                 lc = model.layerCount
 *                 model.deleteLink((lc-1, 0), (lc-2, 0))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_driver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_model = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":493
 *             # si le modele est lineaire, le lien vers la tte est rendu fixe
 *                 model = self.driver.mainModel
 *                 lc = model.layerCount             # <<<<<<<<<<<<<<
 *                 model.deleteLink((lc-1, 0), (lc-2, 0))
 *                 model.createLink((lc-1, 0), (lc-2, 0), style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_layerCount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_lc = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":494
 *                 model = self.driver.mainModel
 *                 lc = model.layerCount
 *                 model.deleteLink((lc-1, 0), (lc-2, 0))             # <<<<<<<<<<<<<<
 *                 model.createLink((lc-1, 0), (lc-2, 0), style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_deleteLink); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_lc, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_lc, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0);
      __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_t_6);
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":495
 *                 lc = model.layerCount
 *                 model.deleteLink((lc-1, 0), (lc-2, 0))
 *                 model.createLink((lc-1, 0), (lc-2, 0), style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)             # <<<<<<<<<<<<<<
 * 
 *         nbroken = token.modelbrokencount
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_createLink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_lc, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_0);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_lc, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
      __pyx_t_7 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_LS_FIXE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_LS_TELQUEL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_style, __pyx_t_7) < 0) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, __pyx_float_1_0) < 0) __PYX_ERR(0, 495, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":490
 *             cuthead = False
 *             curmodel = self
 *             if lin and (self.hidden == 1):             # <<<<<<<<<<<<<<
 *             # si le modele est lineaire, le lien vers la tte est rendu fixe
 *                 model = self.driver.mainModel
 */
    }
  }
  __pyx_L3:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":497
 *                 model.createLink((lc-1, 0), (lc-2, 0), style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)
 * 
 *         nbroken = token.modelbrokencount             # <<<<<<<<<<<<<<
 *         suffix = "*"* nbroken
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_modelbrokencount); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_nbroken = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":498
 * 
 *         nbroken = token.modelbrokencount
 *         suffix = "*"* nbroken             # <<<<<<<<<<<<<<
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)
 *         ll = curmodel.driver.mainModel.layerLength(1)
 */
  __pyx_t_7 = PyNumber_Multiply(__pyx_kp_u__29, __pyx_v_nbroken); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_suffix = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":499
 *         nbroken = token.modelbrokencount
 *         suffix = "*"* nbroken
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)             # <<<<<<<<<<<<<<
 *         ll = curmodel.driver.mainModel.layerLength(1)
 *         N = curmodel.driver.inputCount
 */
  __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_12 = 127;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_richsymbol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_12;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_suffix), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_12;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__30);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__30);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__30);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_numero); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_12;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_st = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":500
 *         suffix = "*"* nbroken
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)
 *         ll = curmodel.driver.mainModel.layerLength(1)             # <<<<<<<<<<<<<<
 *         N = curmodel.driver.inputCount
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_layerLength); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_ll = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":501
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)
 *         ll = curmodel.driver.mainModel.layerLength(1)
 *         N = curmodel.driver.inputCount             # <<<<<<<<<<<<<<
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 *         for node in curmodel.driver.mainModel.nodes[N:-1]:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inputCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_N = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":503
 *         N = curmodel.driver.inputCount
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 *         for node in curmodel.driver.mainModel.nodes[N:-1]:             # <<<<<<<<<<<<<<
 *             node.atom = token.symbol
 *             node.name = "[%s]%s"% (st, node.name)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_nodes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, -1L, &__pyx_v_N, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  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_2 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 503, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_13(__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, 503, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":504
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 *         for node in curmodel.driver.mainModel.nodes[N:-1]:
 *             node.atom = token.symbol             # <<<<<<<<<<<<<<
 *             node.name = "[%s]%s"% (st, node.name)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_symbol); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_node, __pyx_n_s_atom, __pyx_t_7) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":505
 *         for node in curmodel.driver.mainModel.nodes[N:-1]:
 *             node.atom = token.symbol
 *             node.name = "[%s]%s"% (st, node.name)             # <<<<<<<<<<<<<<
 * 
 *         # recherche des entrees pertinentes
 */
    __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_14 = 0;
    __pyx_t_12 = 127;
    __Pyx_INCREF(__pyx_kp_u__32);
    __pyx_t_14 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__32);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u__32);
    __Pyx_INCREF(__pyx_v_st);
    __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_st) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_st) : __pyx_t_12;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_st);
    __Pyx_GIVEREF(__pyx_v_st);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_st);
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_14 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__33);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_12;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_node, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":503
 *         N = curmodel.driver.inputCount
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 *         for node in curmodel.driver.mainModel.nodes[N:-1]:             # <<<<<<<<<<<<<<
 *             node.atom = token.symbol
 *             node.name = "[%s]%s"% (st, node.name)
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":508
 * 
 *         # recherche des entrees pertinentes
 *         pertinent = [token.symbol]             # <<<<<<<<<<<<<<
 *         if mergeisochi:
 *             val = token.iso + token.chiral
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_symbol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_v_pertinent = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":509
 *         # recherche des entrees pertinentes
 *         pertinent = [token.symbol]
 *         if mergeisochi:             # <<<<<<<<<<<<<<
 *             val = token.iso + token.chiral
 *             if val > self.isomax:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_mergeisochi); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":510
 *         pertinent = [token.symbol]
 *         if mergeisochi:
 *             val = token.iso + token.chiral             # <<<<<<<<<<<<<<
 *             if val > self.isomax:
 *                 raise GMModelError('exceeding iso and chiral value"%s"'% val)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_iso); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_chiral); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":511
 *         if mergeisochi:
 *             val = token.iso + token.chiral
 *             if val > self.isomax:             # <<<<<<<<<<<<<<
 *                 raise GMModelError('exceeding iso and chiral value"%s"'% val)
 *             pertinent += [isokey(val)]
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isomax); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_t_3)) {

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":512
 *             val = token.iso + token.chiral
 *             if val > self.isomax:
 *                 raise GMModelError('exceeding iso and chiral value"%s"'% val)             # <<<<<<<<<<<<<<
 *             pertinent += [isokey(val)]
 *         else:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_GMModelError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_exceeding_iso_and_chiral_value_s, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 512, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __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_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 512, __pyx_L1_error)

      /* "metaphor/chem_gm/core/graphmachineworkshop.py":511
 *         if mergeisochi:
 *             val = token.iso + token.chiral
 *             if val > self.isomax:             # <<<<<<<<<<<<<<
 *                 raise GMModelError('exceeding iso and chiral value"%s"'% val)
 *             pertinent += [isokey(val)]
 */
    }

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":513
 *             if val > self.isomax:
 *                 raise GMModelError('exceeding iso and chiral value"%s"'% val)
 *             pertinent += [isokey(val)]             # <<<<<<<<<<<<<<
 *         else:
 *             val = token.iso
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __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_9, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __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_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_val);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_pertinent, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_pertinent, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":509
 *         # recherche des entrees pertinentes
 *         pertinent = [token.symbol]
 *         if mergeisochi:             # <<<<<<<<<<<<<<
 *             val = token.iso + token.chiral
 *             if val > self.isomax:
 */
    goto __pyx_L9;
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":515
 *             pertinent += [isokey(val)]
 *         else:
 *             val = token.iso             # <<<<<<<<<<<<<<
 *             pertinent += [isokey(val)]
 *             val = token.chiral
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_iso); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":516
 *         else:
 *             val = token.iso
 *             pertinent += [isokey(val)]             # <<<<<<<<<<<<<<
 *             val = token.chiral
 *             pertinent += [chikey(val)]
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __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_1, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 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_1, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __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 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_pertinent, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_pertinent, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":517
 *             val = token.iso
 *             pertinent += [isokey(val)]
 *             val = token.chiral             # <<<<<<<<<<<<<<
 *             pertinent += [chikey(val)]
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_chiral); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":518
 *             pertinent += [isokey(val)]
 *             val = token.chiral
 *             pertinent += [chikey(val)]             # <<<<<<<<<<<<<<
 * 
 *         #if token.grade > self.grademax:
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_chikey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __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_9, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __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_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_val};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_val);
        __Pyx_GIVEREF(__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_val);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_pertinent, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_pertinent, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;
  }
  __pyx_L9:;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":522
 *         #if token.grade > self.grademax:
 *         #    raise GMModelError('exceeding grade value"%s"'% token.grade)
 *         if token.grade:             # <<<<<<<<<<<<<<
 *             pertinent += [gradekey(token.grade)]
 *         if token.charge:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_grade); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":523
 *         #    raise GMModelError('exceeding grade value"%s"'% token.grade)
 *         if token.grade:
 *             pertinent += [gradekey(token.grade)]             # <<<<<<<<<<<<<<
 *         if token.charge:
 *             pertinent.append(chargekey(token.charge))
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_gradekey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_grade); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_pertinent, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_pertinent, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":522
 *         #if token.grade > self.grademax:
 *         #    raise GMModelError('exceeding grade value"%s"'% token.grade)
 *         if token.grade:             # <<<<<<<<<<<<<<
 *             pertinent += [gradekey(token.grade)]
 *         if token.charge:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":524
 *         if token.grade:
 *             pertinent += [gradekey(token.grade)]
 *         if token.charge:             # <<<<<<<<<<<<<<
 *             pertinent.append(chargekey(token.charge))
 * #             if token.charge > 0:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_charge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":525
 *             pertinent += [gradekey(token.grade)]
 *         if token.charge:
 *             pertinent.append(chargekey(token.charge))             # <<<<<<<<<<<<<<
 * #             if token.charge > 0:
 * #                 pertinent.append("+%d"%token.charge)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_chargekey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_token, __pyx_n_s_charge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __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_15 = __Pyx_PyList_Append(__pyx_v_pertinent, __pyx_t_6); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":524
 *         if token.grade:
 *             pertinent += [gradekey(token.grade)]
 *         if token.charge:             # <<<<<<<<<<<<<<
 *             pertinent.append(chargekey(token.charge))
 * #             if token.charge > 0:
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":530
 * #             else:
 * #                 pertinent.append(str(token.charge))
 *         pertinent.extend(stickerlist)             # <<<<<<<<<<<<<<
 * 
 *         #elimination des entrees non pertinentes
 */
  __pyx_t_15 = __Pyx_PyList_Extend(__pyx_v_pertinent, __pyx_v_stickerlist); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 530, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":534
 *         #elimination des entrees non pertinentes
 *         #if newfactory:
 *         impertinent = [index for index, name in enumerate(curmodel.driver.mainModel.inputNames) if not name in pertinent]             # <<<<<<<<<<<<<<
 *         #else:
 *         #    impertinent = [index for index, name in enumerate(curmodel.driver.inputNames) if not name in pertinent]
 */
  { /* enter inner scope */
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_7 = __pyx_int_0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_driver); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_mainModel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inputNames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 534, __pyx_L15_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L15_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L15_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_13(__pyx_t_4);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 534, __pyx_L15_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_name, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_index, __pyx_t_7);
      __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7);
      __pyx_t_7 = __pyx_t_9;
      __pyx_t_9 = 0;
      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr5__pyx_v_name, __pyx_v_pertinent, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 534, __pyx_L15_error)
      __pyx_t_10 = (__pyx_t_3 != 0);
      if (__pyx_t_10) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_8genexpr5__pyx_v_index))) __PYX_ERR(0, 534, __pyx_L15_error)
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_index); __pyx_8genexpr5__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0;
    goto __pyx_L19_exit_scope;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_index); __pyx_8genexpr5__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name); __pyx_8genexpr5__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L19_exit_scope:;
  } /* exit inner scope */
  __pyx_v_impertinent = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":537
 *         #else:
 *         #    impertinent = [index for index, name in enumerate(curmodel.driver.inputNames) if not name in pertinent]
 *         for index in impertinent[-1::-1]:             # <<<<<<<<<<<<<<
 *             #freeinput(index, ll)
 *             curmodel.isolateInput(index)
 */
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_impertinent, __pyx_slice__34); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 537, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":539
 *         for index in impertinent[-1::-1]:
 *             #freeinput(index, ll)
 *             curmodel.isolateInput(index)             # <<<<<<<<<<<<<<
 * 
 *         if cuthead: # supprimer la couche de sortie
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_isolateInput); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_index};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __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_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_index};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_index);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":537
 *         #else:
 *         #    impertinent = [index for index, name in enumerate(curmodel.driver.inputNames) if not name in pertinent]
 *         for index in impertinent[-1::-1]:             # <<<<<<<<<<<<<<
 *             #freeinput(index, ll)
 *             curmodel.isolateInput(index)
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":541
 *             curmodel.isolateInput(index)
 * 
 *         if cuthead: # supprimer la couche de sortie             # <<<<<<<<<<<<<<
 *             curmodel.deleteLayer(0, C.PS_KEEP_LINKS + C.PS_END) #
 * 
 */
  __pyx_t_10 = (__pyx_v_cuthead != 0);
  if (__pyx_t_10) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":542
 * 
 *         if cuthead: # supprimer la couche de sortie
 *             curmodel.deleteLayer(0, C.PS_KEEP_LINKS + C.PS_END) #             # <<<<<<<<<<<<<<
 * 
 *         return curmodel # retourne le NdkWorkshop(cr ou self modifi)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_curmodel, __pyx_n_s_deleteLayer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PS_KEEP_LINKS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PS_END); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_int_0, __pyx_t_4};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_int_0, __pyx_t_4};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_11, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":541
 *             curmodel.isolateInput(index)
 * 
 *         if cuthead: # supprimer la couche de sortie             # <<<<<<<<<<<<<<
 *             curmodel.deleteLayer(0, C.PS_KEEP_LINKS + C.PS_END) #
 * 
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":544
 *             curmodel.deleteLayer(0, C.PS_KEEP_LINKS + C.PS_END) #
 * 
 *         return curmodel # retourne le NdkWorkshop(cr ou self modifi)             # <<<<<<<<<<<<<<
 * 
 * #===============================================================================
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_curmodel);
  __pyx_r = __pyx_v_curmodel;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":473
 * 
 * #----------------------------------------------------------------------------
 *     def _specialisermodele(self, token, lin=False, stickerlist=[], mergeisochi=True):   # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Spcialisation d'un modle bauche complet, en fonction du contenu du jeton "token" de type SmiToken.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.graphmachineworkshop.GMWorshop._specialisermodele", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_curmodel);
  __Pyx_XDECREF(__pyx_v_model);
  __Pyx_XDECREF(__pyx_v_lc);
  __Pyx_XDECREF(__pyx_v_nbroken);
  __Pyx_XDECREF(__pyx_v_suffix);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_ll);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_node);
  __Pyx_XDECREF(__pyx_v_pertinent);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_impertinent);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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_graphmachineworkshop(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_graphmachineworkshop},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "graphmachineworkshop",
    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_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_Atomes, __pyx_k_Atomes, sizeof(__pyx_k_Atomes), 0, 0, 1, 1},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
  {&__pyx_n_s_CM_PARAMETERS, __pyx_k_CM_PARAMETERS, sizeof(__pyx_k_CM_PARAMETERS), 0, 0, 1, 1},
  {&__pyx_kp_u_CNOmodel_nml, __pyx_k_CNOmodel_nml, sizeof(__pyx_k_CNOmodel_nml), 0, 1, 0, 0},
  {&__pyx_kp_u_CNmodel_nml, __pyx_k_CNmodel_nml, sizeof(__pyx_k_CNmodel_nml), 0, 1, 0, 0},
  {&__pyx_n_u_Chi, __pyx_k_Chi, sizeof(__pyx_k_Chi), 0, 1, 0, 1},
  {&__pyx_kp_u_Cmodel_nml, __pyx_k_Cmodel_nml, sizeof(__pyx_k_Cmodel_nml), 0, 1, 0, 0},
  {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
  {&__pyx_n_u_Elementary_Graph_Net, __pyx_k_Elementary_Graph_Net, sizeof(__pyx_k_Elementary_Graph_Net), 0, 1, 0, 1},
  {&__pyx_kp_u_Error_in_model_merging_s, __pyx_k_Error_in_model_merging_s, sizeof(__pyx_k_Error_in_model_merging_s), 0, 1, 0, 0},
  {&__pyx_n_s_GMModelError, __pyx_k_GMModelError, sizeof(__pyx_k_GMModelError), 0, 0, 1, 1},
  {&__pyx_n_s_iso885915_GMModelError, __pyx_k_GMModelError, sizeof(__pyx_k_GMModelError), "iso-8859-15", 0, 1, 1},
  {&__pyx_n_s_GMWorshop, __pyx_k_GMWorshop, sizeof(__pyx_k_GMWorshop), 0, 0, 1, 1},
  {&__pyx_n_s_iso885915_GMWorshop, __pyx_k_GMWorshop, sizeof(__pyx_k_GMWorshop), "iso-8859-15", 0, 1, 1},
  {&__pyx_n_s_GMWorshop___init, __pyx_k_GMWorshop___init, sizeof(__pyx_k_GMWorshop___init), 0, 0, 1, 1},
  {&__pyx_n_s_GMWorshop__specialisermodele, __pyx_k_GMWorshop__specialisermodele, sizeof(__pyx_k_GMWorshop__specialisermodele), 0, 0, 1, 1},
  {&__pyx_n_s_GMWorshop_addtokenrow, __pyx_k_GMWorshop_addtokenrow, sizeof(__pyx_k_GMWorshop_addtokenrow), 0, 0, 1, 1},
  {&__pyx_n_s_GMWorshop_finishmodel, __pyx_k_GMWorshop_finishmodel, sizeof(__pyx_k_GMWorshop_finishmodel), 0, 0, 1, 1},
  {&__pyx_n_s_GMWorshop_removeorphans, __pyx_k_GMWorshop_removeorphans, sizeof(__pyx_k_GMWorshop_removeorphans), 0, 0, 1, 1},
  {&__pyx_kp_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 0},
  {&__pyx_n_u_H0, __pyx_k_H0, sizeof(__pyx_k_H0), 0, 1, 0, 1},
  {&__pyx_n_u_H1, __pyx_k_H1, sizeof(__pyx_k_H1), 0, 1, 0, 1},
  {&__pyx_n_s_H1layerdata, __pyx_k_H1layerdata, sizeof(__pyx_k_H1layerdata), 0, 0, 1, 1},
  {&__pyx_n_s_H2layerdata, __pyx_k_H2layerdata, sizeof(__pyx_k_H2layerdata), 0, 0, 1, 1},
  {&__pyx_kp_s_Htitage_de_monal_modelworkshop, __pyx_k_Htitage_de_monal_modelworkshop, sizeof(__pyx_k_Htitage_de_monal_modelworkshop), 0, 0, 1, 0},
  {&__pyx_n_s_II_P_LAYER_LENGTH, __pyx_k_II_P_LAYER_LENGTH, sizeof(__pyx_k_II_P_LAYER_LENGTH), 0, 0, 1, 1},
  {&__pyx_n_s_II_P_SYN_CHILDREN, __pyx_k_II_P_SYN_CHILDREN, sizeof(__pyx_k_II_P_SYN_CHILDREN), 0, 0, 1, 1},
  {&__pyx_n_s_II_P_SYN_PARENTS, __pyx_k_II_P_SYN_PARENTS, sizeof(__pyx_k_II_P_SYN_PARENTS), 0, 0, 1, 1},
  {&__pyx_n_s_INPUT_COUNT, __pyx_k_INPUT_COUNT, sizeof(__pyx_k_INPUT_COUNT), 0, 0, 1, 1},
  {&__pyx_n_u_Iso, __pyx_k_Iso, sizeof(__pyx_k_Iso), 0, 1, 0, 1},
  {&__pyx_n_s_LAYER_COUNT, __pyx_k_LAYER_COUNT, sizeof(__pyx_k_LAYER_COUNT), 0, 0, 1, 1},
  {&__pyx_n_s_LS_FIXE, __pyx_k_LS_FIXE, sizeof(__pyx_k_LS_FIXE), 0, 0, 1, 1},
  {&__pyx_n_s_LS_TELQUEL, __pyx_k_LS_TELQUEL, sizeof(__pyx_k_LS_TELQUEL), 0, 0, 1, 1},
  {&__pyx_n_s_LayerData, __pyx_k_LayerData, sizeof(__pyx_k_LayerData), 0, 0, 1, 1},
  {&__pyx_kp_u_Mon_modele_Graph_Machine, __pyx_k_Mon_modele_Graph_Machine, sizeof(__pyx_k_Mon_modele_Graph_Machine), 0, 1, 0, 0},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1},
  {&__pyx_n_s_NetworkFactory, __pyx_k_NetworkFactory, sizeof(__pyx_k_NetworkFactory), 0, 0, 1, 1},
  {&__pyx_kp_u_Nmodel_nml, __pyx_k_Nmodel_nml, sizeof(__pyx_k_Nmodel_nml), 0, 1, 0, 0},
  {&__pyx_n_u_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 1, 0, 1},
  {&__pyx_kp_u_Omodel_nml, __pyx_k_Omodel_nml, sizeof(__pyx_k_Omodel_nml), 0, 1, 0, 0},
  {&__pyx_n_s_PS_END, __pyx_k_PS_END, sizeof(__pyx_k_PS_END), 0, 0, 1, 1},
  {&__pyx_n_s_PS_KEEP_LINKS, __pyx_k_PS_KEEP_LINKS, sizeof(__pyx_k_PS_KEEP_LINKS), 0, 0, 1, 1},
  {&__pyx_n_u_SIGMOID, __pyx_k_SIGMOID, sizeof(__pyx_k_SIGMOID), 0, 1, 0, 1},
  {&__pyx_n_s_SmiError, __pyx_k_SmiError, sizeof(__pyx_k_SmiError), 0, 0, 1, 1},
  {&__pyx_n_s_SmiToken, __pyx_k_SmiToken, sizeof(__pyx_k_SmiToken), 0, 0, 1, 1},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__pyx_n_u_TANH, __pyx_k_TANH, sizeof(__pyx_k_TANH), 0, 1, 0, 1},
  {&__pyx_n_u_Unit, __pyx_k_Unit, sizeof(__pyx_k_Unit), 0, 1, 0, 1},
  {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0},
  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_n_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 1},
  {&__pyx_n_s_actionC1, __pyx_k_actionC1, sizeof(__pyx_k_actionC1), 0, 0, 1, 1},
  {&__pyx_n_s_activfunc, __pyx_k_activfunc, sizeof(__pyx_k_activfunc), 0, 0, 1, 1},
  {&__pyx_n_s_addComment, __pyx_k_addComment, sizeof(__pyx_k_addComment), 0, 0, 1, 1},
  {&__pyx_n_s_addLayer, __pyx_k_addLayer, sizeof(__pyx_k_addLayer), 0, 0, 1, 1},
  {&__pyx_n_s_addLayers, __pyx_k_addLayers, sizeof(__pyx_k_addLayers), 0, 0, 1, 1},
  {&__pyx_n_s_addLink, __pyx_k_addLink, sizeof(__pyx_k_addLink), 0, 0, 1, 1},
  {&__pyx_n_s_addtokenrow, __pyx_k_addtokenrow, sizeof(__pyx_k_addtokenrow), 0, 0, 1, 1},
  {&__pyx_n_s_afunc, __pyx_k_afunc, sizeof(__pyx_k_afunc), 0, 0, 1, 1},
  {&__pyx_n_s_alphagen, __pyx_k_alphagen, sizeof(__pyx_k_alphagen), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_atom, __pyx_k_atom, sizeof(__pyx_k_atom), 0, 0, 1, 1},
  {&__pyx_n_s_atoms, __pyx_k_atoms, sizeof(__pyx_k_atoms), 0, 0, 1, 1},
  {&__pyx_n_s_bias, __pyx_k_bias, sizeof(__pyx_k_bias), 0, 0, 1, 1},
  {&__pyx_n_s_bonds, __pyx_k_bonds, sizeof(__pyx_k_bonds), 0, 0, 1, 1},
  {&__pyx_n_s_byname, __pyx_k_byname, sizeof(__pyx_k_byname), 0, 0, 1, 1},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_cc, __pyx_k_cc, sizeof(__pyx_k_cc), 0, 0, 1, 1},
  {&__pyx_n_s_charge, __pyx_k_charge, sizeof(__pyx_k_charge), 0, 0, 1, 1},
  {&__pyx_n_s_chargekey, __pyx_k_chargekey, sizeof(__pyx_k_chargekey), 0, 0, 1, 1},
  {&__pyx_n_s_chargelist, __pyx_k_chargelist, sizeof(__pyx_k_chargelist), 0, 0, 1, 1},
  {&__pyx_n_s_chikey, __pyx_k_chikey, sizeof(__pyx_k_chikey), 0, 0, 1, 1},
  {&__pyx_n_s_chiral, __pyx_k_chiral, sizeof(__pyx_k_chiral), 0, 0, 1, 1},
  {&__pyx_n_s_chirality, __pyx_k_chirality, sizeof(__pyx_k_chirality), 0, 0, 1, 1},
  {&__pyx_n_s_chiralmax, __pyx_k_chiralmax, sizeof(__pyx_k_chiralmax), 0, 0, 1, 1},
  {&__pyx_n_s_classif, __pyx_k_classif, sizeof(__pyx_k_classif), 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_compactModel, __pyx_k_compactModel, sizeof(__pyx_k_compactModel), 0, 0, 1, 1},
  {&__pyx_n_s_compactness, __pyx_k_compactness, sizeof(__pyx_k_compactness), 0, 0, 1, 1},
  {&__pyx_n_s_coniso, __pyx_k_coniso, sizeof(__pyx_k_coniso), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_connectLayer, __pyx_k_connectLayer, sizeof(__pyx_k_connectLayer), 0, 0, 1, 1},
  {&__pyx_kp_u_connect_2, __pyx_k_connect_2, sizeof(__pyx_k_connect_2), 0, 1, 0, 0},
  {&__pyx_n_s_connectdef, __pyx_k_connectdef, sizeof(__pyx_k_connectdef), 0, 0, 1, 1},
  {&__pyx_n_s_connexions, __pyx_k_connexions, sizeof(__pyx_k_connexions), 0, 0, 1, 1},
  {&__pyx_kp_u_constant_inputs_integrated_in_bi, __pyx_k_constant_inputs_integrated_in_bi, sizeof(__pyx_k_constant_inputs_integrated_in_bi), 0, 1, 0, 0},
  {&__pyx_kp_u_constant_inputs_integrated_in_co, __pyx_k_constant_inputs_integrated_in_co, sizeof(__pyx_k_constant_inputs_integrated_in_co), 0, 1, 0, 0},
  {&__pyx_kp_u_constant_inputs_integrated_in_la, __pyx_k_constant_inputs_integrated_in_la, sizeof(__pyx_k_constant_inputs_integrated_in_la), 0, 1, 0, 0},
  {&__pyx_n_s_createLink, __pyx_k_createLink, sizeof(__pyx_k_createLink), 0, 0, 1, 1},
  {&__pyx_n_s_cumul, __pyx_k_cumul, sizeof(__pyx_k_cumul), 0, 0, 1, 1},
  {&__pyx_n_s_curID, __pyx_k_curID, sizeof(__pyx_k_curID), 0, 0, 1, 1},
  {&__pyx_n_s_curmodel, __pyx_k_curmodel, sizeof(__pyx_k_curmodel), 0, 0, 1, 1},
  {&__pyx_n_s_cuthead, __pyx_k_cuthead, sizeof(__pyx_k_cuthead), 0, 0, 1, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_defaultnodevalue, __pyx_k_defaultnodevalue, sizeof(__pyx_k_defaultnodevalue), 0, 0, 1, 1},
  {&__pyx_n_s_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 0, 1, 1},
  {&__pyx_n_s_deleteLayer, __pyx_k_deleteLayer, sizeof(__pyx_k_deleteLayer), 0, 0, 1, 1},
  {&__pyx_n_s_deleteLink, __pyx_k_deleteLink, sizeof(__pyx_k_deleteLink), 0, 0, 1, 1},
  {&__pyx_n_s_deleteNode, __pyx_k_deleteNode, sizeof(__pyx_k_deleteNode), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_ebauche, __pyx_k_ebauche, sizeof(__pyx_k_ebauche), 0, 0, 1, 1},
  {&__pyx_kp_u_ebauche_nml, __pyx_k_ebauche_nml, sizeof(__pyx_k_ebauche_nml), 0, 1, 0, 0},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_kp_u_exceeding_iso_and_chiral_value_s, __pyx_k_exceeding_iso_and_chiral_value_s, sizeof(__pyx_k_exceeding_iso_and_chiral_value_s), 0, 1, 0, 0},
  {&__pyx_n_s_extraInputCount, __pyx_k_extraInputCount, sizeof(__pyx_k_extraInputCount), 0, 0, 1, 1},
  {&__pyx_n_s_factory, __pyx_k_factory, sizeof(__pyx_k_factory), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_finishmodel, __pyx_k_finishmodel, sizeof(__pyx_k_finishmodel), 0, 0, 1, 1},
  {&__pyx_n_s_firstlayer, __pyx_k_firstlayer, sizeof(__pyx_k_firstlayer), 0, 0, 1, 1},
  {&__pyx_n_s_firstnode, __pyx_k_firstnode, sizeof(__pyx_k_firstnode), 0, 0, 1, 1},
  {&__pyx_n_s_fixed1, __pyx_k_fixed1, sizeof(__pyx_k_fixed1), 0, 0, 1, 1},
  {&__pyx_n_s_gmutils, __pyx_k_gmutils, sizeof(__pyx_k_gmutils), 0, 0, 1, 1},
  {&__pyx_n_s_grade, __pyx_k_grade, sizeof(__pyx_k_grade), 0, 0, 1, 1},
  {&__pyx_n_s_gradekey, __pyx_k_gradekey, sizeof(__pyx_k_gradekey), 0, 0, 1, 1},
  {&__pyx_n_s_grademax, __pyx_k_grademax, sizeof(__pyx_k_grademax), 0, 0, 1, 1},
  {&__pyx_n_s_hidden, __pyx_k_hidden, sizeof(__pyx_k_hidden), 0, 0, 1, 1},
  {&__pyx_kp_u_hiddenatom_d, __pyx_k_hiddenatom_d, sizeof(__pyx_k_hiddenatom_d), 0, 1, 0, 0},
  {&__pyx_n_s_hiddenindex, __pyx_k_hiddenindex, sizeof(__pyx_k_hiddenindex), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_iChi, __pyx_k_iChi, sizeof(__pyx_k_iChi), 0, 0, 1, 1},
  {&__pyx_n_s_iDegre, __pyx_k_iDegre, sizeof(__pyx_k_iDegre), 0, 0, 1, 1},
  {&__pyx_n_s_iIso, __pyx_k_iIso, sizeof(__pyx_k_iIso), 0, 0, 1, 1},
  {&__pyx_n_s_ilayer, __pyx_k_ilayer, sizeof(__pyx_k_ilayer), 0, 0, 1, 1},
  {&__pyx_n_s_impertinent, __pyx_k_impertinent, sizeof(__pyx_k_impertinent), 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_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_inlist, __pyx_k_inlist, sizeof(__pyx_k_inlist), 0, 0, 1, 1},
  {&__pyx_n_s_inputCount, __pyx_k_inputCount, sizeof(__pyx_k_inputCount), 0, 0, 1, 1},
  {&__pyx_n_s_inputNames, __pyx_k_inputNames, sizeof(__pyx_k_inputNames), 0, 0, 1, 1},
  {&__pyx_n_s_inputs, __pyx_k_inputs, sizeof(__pyx_k_inputs), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_isLinear, __pyx_k_isLinear, sizeof(__pyx_k_isLinear), 0, 0, 1, 1},
  {&__pyx_n_s_iso, __pyx_k_iso, sizeof(__pyx_k_iso), 0, 0, 1, 1},
  {&__pyx_n_s_isokey, __pyx_k_isokey, sizeof(__pyx_k_isokey), 0, 0, 1, 1},
  {&__pyx_n_s_isolateInput, __pyx_k_isolateInput, sizeof(__pyx_k_isolateInput), 0, 0, 1, 1},
  {&__pyx_n_s_isomax, __pyx_k_isomax, sizeof(__pyx_k_isomax), 0, 0, 1, 1},
  {&__pyx_n_s_isomer, __pyx_k_isomer, sizeof(__pyx_k_isomer), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_keepend, __pyx_k_keepend, sizeof(__pyx_k_keepend), 0, 0, 1, 1},
  {&__pyx_kp_u_keepend_d, __pyx_k_keepend_d, sizeof(__pyx_k_keepend_d), 0, 1, 0, 0},
  {&__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_lastlayer, __pyx_k_lastlayer, sizeof(__pyx_k_lastlayer), 0, 0, 1, 1},
  {&__pyx_n_s_layerCount, __pyx_k_layerCount, sizeof(__pyx_k_layerCount), 0, 0, 1, 1},
  {&__pyx_n_s_layerLength, __pyx_k_layerLength, sizeof(__pyx_k_layerLength), 0, 0, 1, 1},
  {&__pyx_n_s_layerindex, __pyx_k_layerindex, sizeof(__pyx_k_layerindex), 0, 0, 1, 1},
  {&__pyx_n_s_layerlist, __pyx_k_layerlist, sizeof(__pyx_k_layerlist), 0, 0, 1, 1},
  {&__pyx_n_s_layershift, __pyx_k_layershift, sizeof(__pyx_k_layershift), 0, 0, 1, 1},
  {&__pyx_n_s_layerstep, __pyx_k_layerstep, sizeof(__pyx_k_layerstep), 0, 0, 1, 1},
  {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_lin, __pyx_k_lin, sizeof(__pyx_k_lin), 0, 0, 1, 1},
  {&__pyx_kp_u_linear_single_layer, __pyx_k_linear_single_layer, sizeof(__pyx_k_linear_single_layer), 0, 1, 0, 0},
  {&__pyx_n_s_ll, __pyx_k_ll, sizeof(__pyx_k_ll), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 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_kp_u_ma_proprit, __pyx_k_ma_proprit, sizeof(__pyx_k_ma_proprit), 0, 1, 0, 0},
  {&__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_mainModel, __pyx_k_mainModel, sizeof(__pyx_k_mainModel), 0, 0, 1, 1},
  {&__pyx_n_s_maxgrade, __pyx_k_maxgrade, sizeof(__pyx_k_maxgrade), 0, 0, 1, 1},
  {&__pyx_n_s_mergeModel, __pyx_k_mergeModel, sizeof(__pyx_k_mergeModel), 0, 0, 1, 1},
  {&__pyx_n_s_mergeNode, __pyx_k_mergeNode, sizeof(__pyx_k_mergeNode), 0, 0, 1, 1},
  {&__pyx_n_s_mergeisochi, __pyx_k_mergeisochi, sizeof(__pyx_k_mergeisochi), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_k_metaphor_chem_gm_core_graphmachi, sizeof(__pyx_k_metaphor_chem_gm_core_graphmachi), 0, 0, 1, 1},
  {&__pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_k_metaphor_chem_gm_core_graphmachi_2, sizeof(__pyx_k_metaphor_chem_gm_core_graphmachi_2), 0, 0, 1, 0},
  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
  {&__pyx_n_s_modelName, __pyx_k_modelName, sizeof(__pyx_k_modelName), 0, 0, 1, 1},
  {&__pyx_n_s_modelWorkshop, __pyx_k_modelWorkshop, sizeof(__pyx_k_modelWorkshop), 0, 0, 1, 1},
  {&__pyx_n_s_modelbrkexcluded, __pyx_k_modelbrkexcluded, sizeof(__pyx_k_modelbrkexcluded), 0, 0, 1, 1},
  {&__pyx_n_s_modelbrokencount, __pyx_k_modelbrokencount, sizeof(__pyx_k_modelbrokencount), 0, 0, 1, 1},
  {&__pyx_n_s_modelname, __pyx_k_modelname, sizeof(__pyx_k_modelname), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_monal, __pyx_k_monal, sizeof(__pyx_k_monal), 0, 0, 1, 1},
  {&__pyx_kp_u_monalPy, __pyx_k_monalPy, sizeof(__pyx_k_monalPy), 0, 1, 0, 0},
  {&__pyx_n_s_monal_driver, __pyx_k_monal_driver, sizeof(__pyx_k_monal_driver), 0, 0, 1, 1},
  {&__pyx_n_s_monal_monalrecords, __pyx_k_monal_monalrecords, sizeof(__pyx_k_monal_monalrecords), 0, 0, 1, 1},
  {&__pyx_n_s_monal_util_modelworkshop, __pyx_k_monal_util_modelworkshop, sizeof(__pyx_k_monal_util_modelworkshop), 0, 0, 1, 1},
  {&__pyx_n_s_monalconst, __pyx_k_monalconst, sizeof(__pyx_k_monalconst), 0, 0, 1, 1},
  {&__pyx_n_s_moveNode, __pyx_k_moveNode, sizeof(__pyx_k_moveNode), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_named, __pyx_k_named, sizeof(__pyx_k_named), 0, 0, 1, 1},
  {&__pyx_n_s_nameloc, __pyx_k_nameloc, sizeof(__pyx_k_nameloc), 0, 0, 1, 1},
  {&__pyx_n_s_natom, __pyx_k_natom, sizeof(__pyx_k_natom), 0, 0, 1, 1},
  {&__pyx_n_s_nbroken, __pyx_k_nbroken, sizeof(__pyx_k_nbroken), 0, 0, 1, 1},
  {&__pyx_n_s_ni, __pyx_k_ni, sizeof(__pyx_k_ni), 0, 0, 1, 1},
  {&__pyx_n_s_ninputmerge, __pyx_k_ninputmerge, sizeof(__pyx_k_ninputmerge), 0, 0, 1, 1},
  {&__pyx_n_s_nlayer, __pyx_k_nlayer, sizeof(__pyx_k_nlayer), 0, 0, 1, 1},
  {&__pyx_n_s_nlayershift, __pyx_k_nlayershift, sizeof(__pyx_k_nlayershift), 0, 0, 1, 1},
  {&__pyx_n_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 1},
  {&__pyx_n_s_nodeNames, __pyx_k_nodeNames, sizeof(__pyx_k_nodeNames), 0, 0, 1, 1},
  {&__pyx_n_s_nodeindex, __pyx_k_nodeindex, sizeof(__pyx_k_nodeindex), 0, 0, 1, 1},
  {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichier, __pyx_k_nomFichier, sizeof(__pyx_k_nomFichier), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichierC, __pyx_k_nomFichierC, sizeof(__pyx_k_nomFichierC), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichierCN, __pyx_k_nomFichierCN, sizeof(__pyx_k_nomFichierCN), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichierCNO, __pyx_k_nomFichierCNO, sizeof(__pyx_k_nomFichierCNO), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichierN, __pyx_k_nomFichierN, sizeof(__pyx_k_nomFichierN), 0, 0, 1, 1},
  {&__pyx_n_s_nomFichierO, __pyx_k_nomFichierO, sizeof(__pyx_k_nomFichierO), 0, 0, 1, 1},
  {&__pyx_n_s_nosynapse, __pyx_k_nosynapse, sizeof(__pyx_k_nosynapse), 0, 0, 1, 1},
  {&__pyx_n_s_numero, __pyx_k_numero, sizeof(__pyx_k_numero), 0, 0, 1, 1},
  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
  {&__pyx_n_s_originindex, __pyx_k_originindex, sizeof(__pyx_k_originindex), 0, 0, 1, 1},
  {&__pyx_n_s_originlayer, __pyx_k_originlayer, sizeof(__pyx_k_originlayer), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_outfunc, __pyx_k_outfunc, sizeof(__pyx_k_outfunc), 0, 0, 1, 1},
  {&__pyx_n_s_outputNames, __pyx_k_outputNames, sizeof(__pyx_k_outputNames), 0, 0, 1, 1},
  {&__pyx_n_s_outputbool, __pyx_k_outputbool, sizeof(__pyx_k_outputbool), 0, 0, 1, 1},
  {&__pyx_n_s_outputname, __pyx_k_outputname, sizeof(__pyx_k_outputname), 0, 0, 1, 1},
  {&__pyx_n_s_outputs, __pyx_k_outputs, sizeof(__pyx_k_outputs), 0, 0, 1, 1},
  {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
  {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pertinent, __pyx_k_pertinent, sizeof(__pyx_k_pertinent), 0, 0, 1, 1},
  {&__pyx_n_u_pm4, __pyx_k_pm4, sizeof(__pyx_k_pm4), 0, 1, 0, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 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_u_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 1, 0, 1},
  {&__pyx_kp_u_python_generated_for_graph_machi, __pyx_k_python_generated_for_graph_machi, sizeof(__pyx_k_python_generated_for_graph_machi), 0, 1, 0, 0},
  {&__pyx_n_u_qm1, __pyx_k_qm1, sizeof(__pyx_k_qm1), 0, 1, 0, 1},
  {&__pyx_n_u_qm2, __pyx_k_qm2, sizeof(__pyx_k_qm2), 0, 1, 0, 1},
  {&__pyx_n_u_qm3, __pyx_k_qm3, sizeof(__pyx_k_qm3), 0, 1, 0, 1},
  {&__pyx_n_u_qp1, __pyx_k_qp1, sizeof(__pyx_k_qp1), 0, 1, 0, 1},
  {&__pyx_n_u_qp2, __pyx_k_qp2, sizeof(__pyx_k_qp2), 0, 1, 0, 1},
  {&__pyx_n_u_qp3, __pyx_k_qp3, sizeof(__pyx_k_qp3), 0, 1, 0, 1},
  {&__pyx_n_u_qp4, __pyx_k_qp4, sizeof(__pyx_k_qp4), 0, 1, 0, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_removeorphans, __pyx_k_removeorphans, sizeof(__pyx_k_removeorphans), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_reseau, __pyx_k_reseau, sizeof(__pyx_k_reseau), 0, 0, 1, 1},
  {&__pyx_n_s_richsymbol, __pyx_k_richsymbol, sizeof(__pyx_k_richsymbol), 0, 0, 1, 1},
  {&__pyx_n_s_saveModel, __pyx_k_saveModel, sizeof(__pyx_k_saveModel), 0, 0, 1, 1},
  {&__pyx_n_u_saved, __pyx_k_saved, sizeof(__pyx_k_saved), 0, 1, 0, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_setNodeValue, __pyx_k_setNodeValue, sizeof(__pyx_k_setNodeValue), 0, 0, 1, 1},
  {&__pyx_n_s_setOutputParams, __pyx_k_setOutputParams, sizeof(__pyx_k_setOutputParams), 0, 0, 1, 1},
  {&__pyx_n_s_sharedsynapses, __pyx_k_sharedsynapses, sizeof(__pyx_k_sharedsynapses), 0, 0, 1, 1},
  {&__pyx_n_s_singlelayer, __pyx_k_singlelayer, sizeof(__pyx_k_singlelayer), 0, 0, 1, 1},
  {&__pyx_n_s_six_moves_cPickle, __pyx_k_six_moves_cPickle, sizeof(__pyx_k_six_moves_cPickle), 0, 0, 1, 1},
  {&__pyx_n_s_smi, __pyx_k_smi, sizeof(__pyx_k_smi), 0, 0, 1, 1},
  {&__pyx_n_s_smiC, __pyx_k_smiC, sizeof(__pyx_k_smiC), 0, 0, 1, 1},
  {&__pyx_n_s_smiN, __pyx_k_smiN, sizeof(__pyx_k_smiN), 0, 0, 1, 1},
  {&__pyx_n_s_smiO, __pyx_k_smiO, sizeof(__pyx_k_smiO), 0, 0, 1, 1},
  {&__pyx_n_s_smitokens, __pyx_k_smitokens, sizeof(__pyx_k_smitokens), 0, 0, 1, 1},
  {&__pyx_n_s_specialisermodele, __pyx_k_specialisermodele, sizeof(__pyx_k_specialisermodele), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stickerlist, __pyx_k_stickerlist, sizeof(__pyx_k_stickerlist), 0, 0, 1, 1},
  {&__pyx_n_s_style, __pyx_k_style, sizeof(__pyx_k_style), 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_symbol, __pyx_k_symbol, sizeof(__pyx_k_symbol), 0, 0, 1, 1},
  {&__pyx_n_s_symbolFromNodeName, __pyx_k_symbolFromNodeName, sizeof(__pyx_k_symbolFromNodeName), 0, 0, 1, 1},
  {&__pyx_n_s_synapseAlign, __pyx_k_synapseAlign, sizeof(__pyx_k_synapseAlign), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_targetindex, __pyx_k_targetindex, sizeof(__pyx_k_targetindex), 0, 0, 1, 1},
  {&__pyx_n_s_targetlayer, __pyx_k_targetlayer, sizeof(__pyx_k_targetlayer), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tok, __pyx_k_tok, sizeof(__pyx_k_tok), 0, 0, 1, 1},
  {&__pyx_n_s_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 0, 1, 1},
  {&__pyx_n_s_tokill, __pyx_k_tokill, sizeof(__pyx_k_tokill), 0, 0, 1, 1},
  {&__pyx_n_s_tokt, __pyx_k_tokt, sizeof(__pyx_k_tokt), 0, 0, 1, 1},
  {&__pyx_n_s_toktable, __pyx_k_toktable, sizeof(__pyx_k_toktable), 0, 0, 1, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_withBias, __pyx_k_withBias, sizeof(__pyx_k_withBias), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 575, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 88, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 218, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 427, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":110
 *             atoms = [Atomes[i] for i in range(atoms)]
 *         elif isinstance(atoms, str):
 *             atoms = atoms.split(',')             # <<<<<<<<<<<<<<
 * 
 *         #ajustement des connectivites. Si la valeur est -1, on la met a self.hidden
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":118
 * 
 *         # suppression des atomes  connectivit nulle
 *         for atom in atoms[-1::-1]:             # <<<<<<<<<<<<<<
 *             if atom in connect.keys():
 *                 if not connect[atom]:
 */
  __pyx_slice__4 = PySlice_New(__pyx_int_neg_1, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__4);
  __Pyx_GIVEREF(__pyx_slice__4);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":141
 * 
 *         if isomer: # ajout des 2 entres pour les isomres
 *             inlist.extend([isokey(index) for index in [1, 2]])             # <<<<<<<<<<<<<<
 *         if chirality: # ajout des 2 entres pour les chiralits
 *             inlist.extend([chikey(index) for index in [1, 2]])
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":143
 *             inlist.extend([isokey(index) for index in [1, 2]])
 *         if chirality: # ajout des 2 entres pour les chiralits
 *             inlist.extend([chikey(index) for index in [1, 2]])             # <<<<<<<<<<<<<<
 *         # ajout des entres pour les degrs suprieurs  1
 *         inlist.extend([gradekey(index + 2) for index in range(maxgrade-1)])
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":182
 *         self.driver.addComment(st)
 *         if self.singlelayer:
 *             self.driver.addComment("linear single layer")             # <<<<<<<<<<<<<<
 *         else:
 *             self.driver.addComment("hiddenatom=%d"% self.hidden)
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_linear_single_layer); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":229
 *             # pour les isomries 1 et 2
 *             try:
 *                 cc = connect[isokey(0)]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc = 0
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":235
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":241
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iIso in [1,2]:             # <<<<<<<<<<<<<<
 *                     #if isokey(iIso) in connect.keys(): supp le 6/11/2014
 *                     curID += 1
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":257
 *             # pour les chiralits 1 et 2
 *             try:
 *                 cc = connect[chikey(0)]             # <<<<<<<<<<<<<<
 *             except:
 *                 cc = 0
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":263
 *                 cc = max(hidden, 1)
 *             if cc:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     for targetindex in range(cc):
 */
  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":269
 *                         self.addLink(0, curID, 1, targetindex, name)
 *             else:
 *                 for iChi in [1,2]:             # <<<<<<<<<<<<<<
 *                     curID += 1
 *                     try:
 */
  __pyx_tuple__14 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":327
 *         if not self.singlelayer:
 *             # commexion de la deuxieme couche  la premiere
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)             # <<<<<<<<<<<<<<
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(3, withBias=1, named=1)
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":329
 *             self.connectLayer(2, withBias=1, named=1, fixed1=self.singlelayer)
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(3, withBias=1, named=1)             # <<<<<<<<<<<<<<
 *         else:
 *             self.connectLayer(1, -1, named=1)
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":331
 *             self.connectLayer(3, withBias=1, named=1)
 *         else:
 *             self.connectLayer(1, -1, named=1)             # <<<<<<<<<<<<<<
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(2, withBias=1, named=1)
 */
  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":333
 *             self.connectLayer(1, -1, named=1)
 *             # connexion de la couche de sortie  la dernire couche cache
 *             self.connectLayer(2, withBias=1, named=1)             # <<<<<<<<<<<<<<
 * 
 *         self.driver.mainModel.synapseAlign()
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":373
 *             # il y a compactage
 *             if compactness == 1:
 *                 self.driver.addComment("constant inputs integrated in layer 1")             # <<<<<<<<<<<<<<
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_constant_inputs_integrated_in_la); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":375
 *                 self.driver.addComment("constant inputs integrated in layer 1")
 *             elif compactness == 2:
 *                 self.driver.addComment("constant inputs integrated in constant layer")             # <<<<<<<<<<<<<<
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_constant_inputs_integrated_in_co); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":377
 *                 self.driver.addComment("constant inputs integrated in constant layer")
 *             elif compactness == 3:
 *                 self.driver.addComment("constant inputs integrated in bias")             # <<<<<<<<<<<<<<
 *             if keepend:
 *                 self.driver.addComment("keepend=%d"% keepend)
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_constant_inputs_integrated_in_bi); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":383
 *             if compactness == 1:
 *             # cration d'une couche vide en 1. On y dplace les entres fixes, et on les connecte au biais
 *                 self.addLayer("", 1)             # <<<<<<<<<<<<<<
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 */
  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_kp_u_, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":387
 *                     n = self.driver.info[C.INPUT_COUNT]-keepend-1
 *                     self.moveNode(0, n, 1, 0, style=C.PS_KEEP_LINKS)
 *                     self.addLink(-1, 0, 1, 0, style=C.LS_FIXE + C.LS_TELQUEL, value=1.0)  #             # <<<<<<<<<<<<<<
 * 
 *             elif compactness == 2:
 */
  __pyx_tuple__24 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":393
 *             # uniquement pour models ndk
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     self.setNodeValue(0, 0, value=1.0)             # <<<<<<<<<<<<<<
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #
 * 
 */
  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":394
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     self.setNodeValue(0, 0, value=1.0)
 *                     self.moveNode(0, 0, -1, 1, style=C.PS_KEEP_LINKS)  #             # <<<<<<<<<<<<<<
 * 
 *             elif compactness == 3:
 */
  __pyx_tuple__26 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":401
 *                 while self.driver.info[C.INPUT_COUNT] > keepend:
 *                     res= self.mergeNode(originlayer=-1, originindex=0, targetlayer=0, targetindex=0, outputbool=1)
 *                     self.deleteNode(0, 0)             # <<<<<<<<<<<<<<
 *                     cumul += 1
 * 
 */
  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":443
 * 
 *             # connexion du nouveau bloc "tok" aux blocs prcdement intgrs, en fonction des liaisons
 *             for target in tok.alphagen(True, modelbrkexcluded=True):  #excluded=tok._b rokenbonds):             # <<<<<<<<<<<<<<
 *                 if target in self.toktable:
 *                     originlayer = tok.lastlayer
 */
  __pyx_tuple__28 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":500
 *         suffix = "*"* nbroken
 *         st = '%s%s, %s'% (token.richsymbol, suffix, token.numero)
 *         ll = curmodel.driver.mainModel.layerLength(1)             # <<<<<<<<<<<<<<
 *         N = curmodel.driver.inputCount
 *         #brlist = [bond for bond in token.cbonds if bond.modelbroken]
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":537
 *         #else:
 *         #    impertinent = [index for index, name in enumerate(curmodel.driver.inputNames) if not name in pertinent]
 *         for index in impertinent[-1::-1]:             # <<<<<<<<<<<<<<
 *             #freeinput(index, ll)
 *             curmodel.isolateInput(index)
 */
  __pyx_slice__34 = PySlice_New(__pyx_int_neg_1, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__34)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__34);
  __Pyx_GIVEREF(__pyx_slice__34);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":83
 *         """
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,             # <<<<<<<<<<<<<<
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",
 */
  __pyx_tuple__35 = PyTuple_Pack(37, __pyx_n_s_self, __pyx_n_s_atoms, __pyx_n_s_hidden, __pyx_n_s_maxgrade, __pyx_n_s_isomer, __pyx_n_s_chirality, __pyx_n_s_connect, __pyx_n_s_classif, __pyx_n_s_chargelist, __pyx_n_s_stickerlist, __pyx_n_s_outputname, __pyx_n_s_modelname, __pyx_n_s_defaultnodevalue, __pyx_n_s_actionC1, __pyx_n_s_afunc, __pyx_n_s_key, __pyx_n_s_atom, __pyx_n_s_val, __pyx_n_s_inlist, __pyx_n_s_H1layerdata, __pyx_n_s_H2layerdata, __pyx_n_s_layerlist, __pyx_n_s_outfunc, __pyx_n_s_st, __pyx_n_s_value, __pyx_n_s_curID, __pyx_n_s_cc, __pyx_n_s_targetindex, __pyx_n_s_name, __pyx_n_s_iIso, __pyx_n_s_iChi, __pyx_n_s_iDegre, __pyx_n_s_nameloc, __pyx_n_s_i, __pyx_n_s_index, __pyx_n_s_index, __pyx_n_s_index); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(13, 0, 37, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_n_s_init, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":356
 *         return
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop             # <<<<<<<<<<<<<<
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):
 */
  __pyx_tuple__37 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_keepend, __pyx_n_s_compactness, __pyx_n_s_params, __pyx_n_s_ni, __pyx_n_s_tokill, __pyx_n_s_i, __pyx_n_s_res, __pyx_n_s_n, __pyx_n_s_cumul, __pyx_n_s_i); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_n_s_finishmodel, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 356, __pyx_L1_error)
  __pyx_tuple__39 = PyTuple_Pack(3, ((PyObject *)__pyx_int_0), ((PyObject *)__pyx_int_3), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":408
 * 
 * #----------------------------------------------------------------------------
 *     def addtokenrow(self, lst, stickerlist, mergeisochi=True):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *     Permet d'intgrer une nouvelle liste de jetons.
 */
  __pyx_tuple__40 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_lst, __pyx_n_s_stickerlist, __pyx_n_s_mergeisochi, __pyx_n_s_ni, __pyx_n_s_layerstep, __pyx_n_s_tokt, __pyx_n_s_layershift, __pyx_n_s_i, __pyx_n_s_tok, __pyx_n_s_curmodel, __pyx_n_s_res, __pyx_n_s_target, __pyx_n_s_originlayer, __pyx_n_s_targetlayer, __pyx_n_s_hiddenindex, __pyx_n_s_originindex, __pyx_n_s_targetindex); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_n_s_addtokenrow, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 408, __pyx_L1_error)
  __pyx_tuple__42 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":457
 * 
 * #----------------------------------------------------------------------------
 *     def removeorphans(self):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Traitement des noeuds orphelins.
 */
  __pyx_tuple__43 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_nlayer, __pyx_n_s_step, __pyx_n_s_ilayer, __pyx_n_s_ll, __pyx_n_s_j, __pyx_n_s_jj, __pyx_n_s_parents); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_n_s_removeorphans, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 457, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":473
 * 
 * #----------------------------------------------------------------------------
 *     def _specialisermodele(self, token, lin=False, stickerlist=[], mergeisochi=True):   # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Spcialisation d'un modle bauche complet, en fonction du contenu du jeton "token" de type SmiToken.
 */
  __pyx_tuple__45 = PyTuple_Pack(21, __pyx_n_s_self, __pyx_n_s_token, __pyx_n_s_lin, __pyx_n_s_stickerlist, __pyx_n_s_mergeisochi, __pyx_n_s_cuthead, __pyx_n_s_curmodel, __pyx_n_s_model, __pyx_n_s_lc, __pyx_n_s_nbroken, __pyx_n_s_suffix, __pyx_n_s_st, __pyx_n_s_ll, __pyx_n_s_N, __pyx_n_s_node, __pyx_n_s_pertinent, __pyx_n_s_val, __pyx_n_s_impertinent, __pyx_n_s_index, __pyx_n_s_index, __pyx_n_s_name); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(5, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_graphmachi_2, __pyx_n_s_specialisermodele, 473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 473, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":577
 *     print("saved", nomFichier)
 * 
 *     smi = SmiToken(None, 'C', order=3)             # <<<<<<<<<<<<<<
 *     smi.numero = 0
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 */
  __pyx_tuple__47 = PyTuple_Pack(2, Py_None, __pyx_n_u_C); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":579
 *     smi = SmiToken(None, 'C', order=3)
 *     smi.numero = 0
 *     smiN = SmiToken(None, 'N', order=2, iso=1)             # <<<<<<<<<<<<<<
 *     smiN.numero = 1
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 */
  __pyx_tuple__48 = PyTuple_Pack(2, Py_None, __pyx_n_u_N); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":581
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 *     smiN.numero = 1
 *     smiO = SmiToken(None, 'O', order=1, iso=2)             # <<<<<<<<<<<<<<
 *     smiO.numero = 2
 *     smiC = SmiToken(None, 'C', order=4)
 */
  __pyx_tuple__49 = PyTuple_Pack(2, Py_None, __pyx_n_u_O); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":583
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 *     smiO.numero = 2
 *     smiC = SmiToken(None, 'C', order=4)             # <<<<<<<<<<<<<<
 *     smiC.numero = 3
 *     smi._bonds.append(smiN)
 */
  __pyx_tuple__50 = PyTuple_Pack(2, Py_None, __pyx_n_u_C); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __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_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __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 ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

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 initgraphmachineworkshop(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initgraphmachineworkshop(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_graphmachineworkshop(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_graphmachineworkshop(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_graphmachineworkshop(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;
  int __pyx_t_9;
  __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_graphmachineworkshop(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("graphmachineworkshop", __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__chem_gm__core__graphmachineworkshop) {
    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.chem_gm.core.graphmachineworkshop")) {
      if (unlikely(PyDict_SetItemString(modules, "metaphor.chem_gm.core.graphmachineworkshop", __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();
  (void)__Pyx_modinit_type_init_code();
  (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/chem_gm/core/graphmachineworkshop.py":27
 * #===============================================================================
 * #import sys
 * from io import StringIO             # <<<<<<<<<<<<<<
 * from six.moves.cPickle import loads, dumps
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_StringIO);
  __Pyx_GIVEREF(__pyx_n_s_StringIO);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StringIO);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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_StringIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":28
 * #import sys
 * from io import StringIO
 * from six.moves.cPickle import loads, dumps             # <<<<<<<<<<<<<<
 * 
 * from ...monal import monalconst as C
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_loads);
  __Pyx_GIVEREF(__pyx_n_s_loads);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_loads);
  __Pyx_INCREF(__pyx_n_s_dumps);
  __Pyx_GIVEREF(__pyx_n_s_dumps);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_dumps);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six_moves_cPickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __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_loads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_loads, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dumps, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":30
 * from six.moves.cPickle import loads, dumps
 * 
 * from ...monal import monalconst as C             # <<<<<<<<<<<<<<
 * from ...monal.util.modelworkshop import modelWorkshop  #newfactory
 * from ...monal.driver import NetworkFactory as factory
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __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_monal, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __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, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_C, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":31
 * 
 * from ...monal import monalconst as C
 * from ...monal.util.modelworkshop import modelWorkshop  #newfactory             # <<<<<<<<<<<<<<
 * from ...monal.driver import NetworkFactory as factory
 * from ...monal.monalrecords import LayerData #, SynapseData, NodeData
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_modelWorkshop);
  __Pyx_GIVEREF(__pyx_n_s_modelWorkshop);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_modelWorkshop);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_monal_util_modelworkshop, __pyx_t_2, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __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_modelWorkshop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_modelWorkshop, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":32
 * from ...monal import monalconst as C
 * from ...monal.util.modelworkshop import modelWorkshop  #newfactory
 * from ...monal.driver import NetworkFactory as factory             # <<<<<<<<<<<<<<
 * from ...monal.monalrecords import LayerData #, SynapseData, NodeData
 * from .smitokens import SmiToken
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_NetworkFactory);
  __Pyx_GIVEREF(__pyx_n_s_NetworkFactory);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NetworkFactory);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_monal_driver, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __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_NetworkFactory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":33
 * from ...monal.util.modelworkshop import modelWorkshop  #newfactory
 * from ...monal.driver import NetworkFactory as factory
 * from ...monal.monalrecords import LayerData #, SynapseData, NodeData             # <<<<<<<<<<<<<<
 * from .smitokens import SmiToken
 * from .atoms import Atomes, SmiError, connectdef
 */
  __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_LayerData);
  __Pyx_GIVEREF(__pyx_n_s_LayerData);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LayerData);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_monal_monalrecords, __pyx_t_2, 3); 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_LayerData); 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_LayerData, __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/chem_gm/core/graphmachineworkshop.py":34
 * from ...monal.driver import NetworkFactory as factory
 * from ...monal.monalrecords import LayerData #, SynapseData, NodeData
 * from .smitokens import SmiToken             # <<<<<<<<<<<<<<
 * from .atoms import Atomes, SmiError, connectdef
 * from .gmutils import gradekey, chikey, isokey, chargekey, symbolFromNodeName
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_SmiToken);
  __Pyx_GIVEREF(__pyx_n_s_SmiToken);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SmiToken);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_smitokens, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __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_SmiToken); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiToken, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":35
 * from ...monal.monalrecords import LayerData #, SynapseData, NodeData
 * from .smitokens import SmiToken
 * from .atoms import Atomes, SmiError, connectdef             # <<<<<<<<<<<<<<
 * from .gmutils import gradekey, chikey, isokey, chargekey, symbolFromNodeName
 * # try:
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Atomes);
  __Pyx_GIVEREF(__pyx_n_s_Atomes);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Atomes);
  __Pyx_INCREF(__pyx_n_s_SmiError);
  __Pyx_GIVEREF(__pyx_n_s_SmiError);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SmiError);
  __Pyx_INCREF(__pyx_n_s_connectdef);
  __Pyx_GIVEREF(__pyx_n_s_connectdef);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_connectdef);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_atoms, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __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_Atomes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Atomes, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SmiError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiError, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_connectdef); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_connectdef, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":36
 * from .smitokens import SmiToken
 * from .atoms import Atomes, SmiError, connectdef
 * from .gmutils import gradekey, chikey, isokey, chargekey, symbolFromNodeName             # <<<<<<<<<<<<<<
 * # try:
 * # except:
 */
  __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_gradekey);
  __Pyx_GIVEREF(__pyx_n_s_gradekey);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gradekey);
  __Pyx_INCREF(__pyx_n_s_chikey);
  __Pyx_GIVEREF(__pyx_n_s_chikey);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_chikey);
  __Pyx_INCREF(__pyx_n_s_isokey);
  __Pyx_GIVEREF(__pyx_n_s_isokey);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isokey);
  __Pyx_INCREF(__pyx_n_s_chargekey);
  __Pyx_GIVEREF(__pyx_n_s_chargekey);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_chargekey);
  __Pyx_INCREF(__pyx_n_s_symbolFromNodeName);
  __Pyx_GIVEREF(__pyx_n_s_symbolFromNodeName);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_symbolFromNodeName);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gmutils, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __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_gradekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradekey, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_chikey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chikey, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isokey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isokey, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_chargekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chargekey, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_symbolFromNodeName); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_symbolFromNodeName, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":52
 * 
 * #-------------------------------------------------------------------------------
 * class GMModelError(SmiError):             # <<<<<<<<<<<<<<
 *     pass
 * #-------------------------------------------------------------------------------
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __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_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_iso885915_GMModelError, __pyx_n_s_GMModelError, (PyObject *) NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_iso885915_GMModelError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iso885915_GMModelError, __pyx_t_4) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":55
 *     pass
 * #-------------------------------------------------------------------------------
 * class GMWorshop( modelWorkshop ):             # <<<<<<<<<<<<<<
 *     """
 *     Htitage de monal.modelworkshop.modelWorkshop, spcialis pour les graph machines
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_modelWorkshop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_iso885915_GMWorshop, __pyx_n_s_GMWorshop, (PyObject *) NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_kp_s_Htitage_de_monal_modelworkshop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":83
 *         """
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,             # <<<<<<<<<<<<<<
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_1__init__, 0, __pyx_n_s_GMWorshop___init, NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 3)) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":84
 * 
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],             # <<<<<<<<<<<<<<
 *             stickerlist=[], outputname="property", modelname="",
 *             defaultnodevalue=0.0):  # GMWorshop
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_connectdef); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_connect = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_chargelist = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":85
 *     def __init__(self, atoms=3, hidden=3, maxgrade=1, isomer=0,
 *             chirality=0, connect=connectdef, classif=None, chargelist=[],
 *             stickerlist=[], outputname="property", modelname="",             # <<<<<<<<<<<<<<
 *             defaultnodevalue=0.0):  # GMWorshop
 * 
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_stickerlist = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop___defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":356
 *         return
 * 
 *     def finishmodel(self, keepend=0, compactness=3, params=None):   # GMWorshop             # <<<<<<<<<<<<<<
 *         ni = self.driver.info[C.INPUT_COUNT]
 *         if (keepend < ni):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_3finishmodel, 0, __pyx_n_s_GMWorshop_finishmodel, NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__39);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_finishmodel, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":408
 * 
 * #----------------------------------------------------------------------------
 *     def addtokenrow(self, lst, stickerlist, mergeisochi=True):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *     Permet d'intgrer une nouvelle liste de jetons.
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_5addtokenrow, 0, __pyx_n_s_GMWorshop_addtokenrow, NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__42);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_addtokenrow, __pyx_t_4) < 0) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":457
 * 
 * #----------------------------------------------------------------------------
 *     def removeorphans(self):  # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Traitement des noeuds orphelins.
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_7removeorphans, 0, __pyx_n_s_GMWorshop_removeorphans, NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_removeorphans, __pyx_t_4) < 0) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":473
 * 
 * #----------------------------------------------------------------------------
 *     def _specialisermodele(self, token, lin=False, stickerlist=[], mergeisochi=True):   # GMWorshop             # <<<<<<<<<<<<<<
 *         """
 *         Spcialisation d'un modle bauche complet, en fonction du contenu du jeton "token" de type SmiToken.
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_20graphmachineworkshop_9GMWorshop_9_specialisermodele, 0, __pyx_n_s_GMWorshop__specialisermodele, NULL, __pyx_n_s_metaphor_chem_gm_core_graphmachi, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 473, __pyx_L1_error)
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_stickerlist = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_8metaphor_7chem_gm_4core_20graphmachineworkshop_2__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_specialisermodele, __pyx_t_4) < 0) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":55
 *     pass
 * #-------------------------------------------------------------------------------
 * class GMWorshop( modelWorkshop ):             # <<<<<<<<<<<<<<
 *     """
 *     Htitage de monal.modelworkshop.modelWorkshop, spcialis pour les graph machines
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_iso885915_GMWorshop, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iso885915_GMWorshop, __pyx_t_4) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":547
 * 
 * #===============================================================================
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     #p rint help(GMWorshop)
 *     import os
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":549
 * if __name__ == "__main__":
 *     #p rint help(GMWorshop)
 *     import os             # <<<<<<<<<<<<<<
 *     #import numpy as np
 *     path = os.path.split(__file__)[0]
 */
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":551
 *     import os
 *     #import numpy as np
 *     path = os.path.split(__file__)[0]             # <<<<<<<<<<<<<<
 *     modelname = "Elementary_Graph_Net"
 *     path = os.path.split(__file__)[0]
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":552
 *     #import numpy as np
 *     path = os.path.split(__file__)[0]
 *     modelname = "Elementary_Graph_Net"             # <<<<<<<<<<<<<<
 *     path = os.path.split(__file__)[0]
 *     atoms = 3                        #['C', 'N', 'O', 'F', 'Cl', 'Br', 'I', 'S', 'P']
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_modelname, __pyx_n_u_Elementary_Graph_Net) < 0) __PYX_ERR(0, 552, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":553
 *     path = os.path.split(__file__)[0]
 *     modelname = "Elementary_Graph_Net"
 *     path = os.path.split(__file__)[0]             # <<<<<<<<<<<<<<
 *     atoms = 3                        #['C', 'N', 'O', 'F', 'Cl', 'Br', 'I', 'S', 'P']
 *     maxgrade = 4
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_path, __pyx_t_3) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":554
 *     modelname = "Elementary_Graph_Net"
 *     path = os.path.split(__file__)[0]
 *     atoms = 3                        #['C', 'N', 'O', 'F', 'Cl', 'Br', 'I', 'S', 'P']             # <<<<<<<<<<<<<<
 *     maxgrade = 4
 *     isomer = 1
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_atoms, __pyx_int_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":555
 *     path = os.path.split(__file__)[0]
 *     atoms = 3                        #['C', 'N', 'O', 'F', 'Cl', 'Br', 'I', 'S', 'P']
 *     maxgrade = 4             # <<<<<<<<<<<<<<
 *     isomer = 1
 *     hidden = 3
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_maxgrade, __pyx_int_4) < 0) __PYX_ERR(0, 555, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":556
 *     atoms = 3                        #['C', 'N', 'O', 'F', 'Cl', 'Br', 'I', 'S', 'P']
 *     maxgrade = 4
 *     isomer = 1             # <<<<<<<<<<<<<<
 *     hidden = 3
 *     connexions = None
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_isomer, __pyx_int_1) < 0) __PYX_ERR(0, 556, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":557
 *     maxgrade = 4
 *     isomer = 1
 *     hidden = 3             # <<<<<<<<<<<<<<
 *     connexions = None
 *     coniso = None
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_hidden, __pyx_int_3) < 0) __PYX_ERR(0, 557, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":558
 *     isomer = 1
 *     hidden = 3
 *     connexions = None             # <<<<<<<<<<<<<<
 *     coniso = None
 *     #degreMax = 1
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_connexions, Py_None) < 0) __PYX_ERR(0, 558, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":559
 *     hidden = 3
 *     connexions = None
 *     coniso = None             # <<<<<<<<<<<<<<
 *     #degreMax = 1
 *     #IsoMax = 1
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_coniso, Py_None) < 0) __PYX_ERR(0, 559, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":562
 *     #degreMax = 1
 *     #IsoMax = 1
 *     classif = 0             # <<<<<<<<<<<<<<
 *     nomFichier = os.path.join(path, "ebauche.nml")
 *     nomFichierC = os.path.join(path, "Cmodel.nml")
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_classif, __pyx_int_0) < 0) __PYX_ERR(0, 562, __pyx_L1_error)

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":563
 *     #IsoMax = 1
 *     classif = 0
 *     nomFichier = os.path.join(path, "ebauche.nml")             # <<<<<<<<<<<<<<
 *     nomFichierC = os.path.join(path, "Cmodel.nml")
 *     nomFichierN = os.path.join(path, "Nmodel.nml")
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __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, 563, __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, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u_ebauche_nml);
    __Pyx_GIVEREF(__pyx_kp_u_ebauche_nml);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_ebauche_nml);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichier, __pyx_t_2) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":564
 *     classif = 0
 *     nomFichier = os.path.join(path, "ebauche.nml")
 *     nomFichierC = os.path.join(path, "Cmodel.nml")             # <<<<<<<<<<<<<<
 *     nomFichierN = os.path.join(path, "Nmodel.nml")
 *     nomFichierO = os.path.join(path, "Omodel.nml")
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_kp_u_Cmodel_nml);
    __Pyx_GIVEREF(__pyx_kp_u_Cmodel_nml);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_Cmodel_nml);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichierC, __pyx_t_1) < 0) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":565
 *     nomFichier = os.path.join(path, "ebauche.nml")
 *     nomFichierC = os.path.join(path, "Cmodel.nml")
 *     nomFichierN = os.path.join(path, "Nmodel.nml")             # <<<<<<<<<<<<<<
 *     nomFichierO = os.path.join(path, "Omodel.nml")
 *     nomFichierCN = os.path.join(path, "CNmodel.nml")
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_Nmodel_nml);
    __Pyx_GIVEREF(__pyx_kp_u_Nmodel_nml);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_Nmodel_nml);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichierN, __pyx_t_3) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":566
 *     nomFichierC = os.path.join(path, "Cmodel.nml")
 *     nomFichierN = os.path.join(path, "Nmodel.nml")
 *     nomFichierO = os.path.join(path, "Omodel.nml")             # <<<<<<<<<<<<<<
 *     nomFichierCN = os.path.join(path, "CNmodel.nml")
 *     nomFichierCNO = os.path.join(path, "CNOmodel.nml")
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __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, 566, __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, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u_Omodel_nml);
    __Pyx_GIVEREF(__pyx_kp_u_Omodel_nml);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_Omodel_nml);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichierO, __pyx_t_2) < 0) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":567
 *     nomFichierN = os.path.join(path, "Nmodel.nml")
 *     nomFichierO = os.path.join(path, "Omodel.nml")
 *     nomFichierCN = os.path.join(path, "CNmodel.nml")             # <<<<<<<<<<<<<<
 *     nomFichierCNO = os.path.join(path, "CNOmodel.nml")
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_kp_u_CNmodel_nml);
    __Pyx_GIVEREF(__pyx_kp_u_CNmodel_nml);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_CNmodel_nml);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichierCN, __pyx_t_1) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":568
 *     nomFichierO = os.path.join(path, "Omodel.nml")
 *     nomFichierCN = os.path.join(path, "CNmodel.nml")
 *     nomFichierCNO = os.path.join(path, "CNOmodel.nml")             # <<<<<<<<<<<<<<
 * 
 *     reseau = GMWorshop(atoms, hidden, maxgrade, isomer, connexions)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_CNOmodel_nml);
    __Pyx_GIVEREF(__pyx_kp_u_CNOmodel_nml);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_CNOmodel_nml);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __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;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_nomFichierCNO, __pyx_t_3) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":570
 *     nomFichierCNO = os.path.join(path, "CNOmodel.nml")
 * 
 *     reseau = GMWorshop(atoms, hidden, maxgrade, isomer, connexions)             # <<<<<<<<<<<<<<
 *     reseau.driver.modelName = "Mon modele Graph Machine"
 *     reseau.driver.outputNames[0] = "ma proprit"
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_GMWorshop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_atoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_maxgrade); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_isomer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_connexions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_7);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_reseau, __pyx_t_7) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":571
 * 
 *     reseau = GMWorshop(atoms, hidden, maxgrade, isomer, connexions)
 *     reseau.driver.modelName = "Mon modele Graph Machine"             # <<<<<<<<<<<<<<
 *     reseau.driver.outputNames[0] = "ma proprit"
 * 
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_driver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_8, __pyx_n_s_modelName, __pyx_kp_u_Mon_modele_Graph_Machine) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":572
 *     reseau = GMWorshop(atoms, hidden, maxgrade, isomer, connexions)
 *     reseau.driver.modelName = "Mon modele Graph Machine"
 *     reseau.driver.outputNames[0] = "ma proprit"             # <<<<<<<<<<<<<<
 * 
 *     reseau.saveModel(nomFichier)
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_driver); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_outputNames); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_t_8, 0, __pyx_kp_u_ma_proprit, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":574
 *     reseau.driver.outputNames[0] = "ma proprit"
 * 
 *     reseau.saveModel(nomFichier)             # <<<<<<<<<<<<<<
 *     print("saved", nomFichier)
 * 
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_saveModel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_nomFichier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":575
 * 
 *     reseau.saveModel(nomFichier)
 *     print("saved", nomFichier)             # <<<<<<<<<<<<<<
 * 
 *     smi = SmiToken(None, 'C', order=3)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nomFichier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_n_u_saved);
    __Pyx_GIVEREF(__pyx_n_u_saved);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_saved);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":577
 *     print("saved", nomFichier)
 * 
 *     smi = SmiToken(None, 'C', order=3)             # <<<<<<<<<<<<<<
 *     smi.numero = 0
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiToken); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_int_3) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_smi, __pyx_t_7) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":578
 * 
 *     smi = SmiToken(None, 'C', order=3)
 *     smi.numero = 0             # <<<<<<<<<<<<<<
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 *     smiN.numero = 1
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s_numero, __pyx_int_0) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":579
 *     smi = SmiToken(None, 'C', order=3)
 *     smi.numero = 0
 *     smiN = SmiToken(None, 'N', order=2, iso=1)             # <<<<<<<<<<<<<<
 *     smiN.numero = 1
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiToken); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_int_2) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_iso, __pyx_int_1) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_smiN, __pyx_t_3) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":580
 *     smi.numero = 0
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 *     smiN.numero = 1             # <<<<<<<<<<<<<<
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 *     smiO.numero = 2
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_numero, __pyx_int_1) < 0) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":581
 *     smiN = SmiToken(None, 'N', order=2, iso=1)
 *     smiN.numero = 1
 *     smiO = SmiToken(None, 'O', order=1, iso=2)             # <<<<<<<<<<<<<<
 *     smiO.numero = 2
 *     smiC = SmiToken(None, 'C', order=4)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiToken); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_int_1) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_iso, __pyx_int_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__49, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_smiO, __pyx_t_7) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":582
 *     smiN.numero = 1
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 *     smiO.numero = 2             # <<<<<<<<<<<<<<
 *     smiC = SmiToken(None, 'C', order=4)
 *     smiC.numero = 3
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiO); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s_numero, __pyx_int_2) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":583
 *     smiO = SmiToken(None, 'O', order=1, iso=2)
 *     smiO.numero = 2
 *     smiC = SmiToken(None, 'C', order=4)             # <<<<<<<<<<<<<<
 *     smiC.numero = 3
 *     smi._bonds.append(smiN)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiToken); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_int_4) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__50, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_smiC, __pyx_t_3) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":584
 *     smiO.numero = 2
 *     smiC = SmiToken(None, 'C', order=4)
 *     smiC.numero = 3             # <<<<<<<<<<<<<<
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiN)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_numero, __pyx_int_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":585
 *     smiC = SmiToken(None, 'C', order=4)
 *     smiC.numero = 3
 *     smi._bonds.append(smiN)             # <<<<<<<<<<<<<<
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiO)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":586
 *     smiC.numero = 3
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiN)             # <<<<<<<<<<<<<<
 *     smi._bonds.append(smiO)
 *     smi._bonds.append(smiC)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":587
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiO)             # <<<<<<<<<<<<<<
 *     smi._bonds.append(smiC)
 *     smiN._bonds.append(smi)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __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/chem_gm/core/graphmachineworkshop.py":588
 *     smi._bonds.append(smiN)
 *     smi._bonds.append(smiO)
 *     smi._bonds.append(smiC)             # <<<<<<<<<<<<<<
 *     smiN._bonds.append(smi)
 *     smiN._bonds.append(smiC)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":589
 *     smi._bonds.append(smiO)
 *     smi._bonds.append(smiC)
 *     smiN._bonds.append(smi)             # <<<<<<<<<<<<<<
 *     smiN._bonds.append(smiC)
 *     smiN._bonds.append(smi)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":590
 *     smi._bonds.append(smiC)
 *     smiN._bonds.append(smi)
 *     smiN._bonds.append(smiC)             # <<<<<<<<<<<<<<
 *     smiN._bonds.append(smi)
 *     smiO._bonds.append(smi)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":591
 *     smiN._bonds.append(smi)
 *     smiN._bonds.append(smiC)
 *     smiN._bonds.append(smi)             # <<<<<<<<<<<<<<
 *     smiO._bonds.append(smi)
 *     smiC._bonds.append(smi)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":592
 *     smiN._bonds.append(smiC)
 *     smiN._bonds.append(smi)
 *     smiO._bonds.append(smi)             # <<<<<<<<<<<<<<
 *     smiC._bonds.append(smi)
 *     smiC._bonds.append(smiN)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":593
 *     smiN._bonds.append(smi)
 *     smiO._bonds.append(smi)
 *     smiC._bonds.append(smi)             # <<<<<<<<<<<<<<
 *     smiC._bonds.append(smiN)
 *     reseau.addtokenrow([smi])
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":594
 *     smiO._bonds.append(smi)
 *     smiC._bonds.append(smi)
 *     smiC._bonds.append(smiN)             # <<<<<<<<<<<<<<
 *     reseau.addtokenrow([smi])
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bonds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":595
 *     smiC._bonds.append(smi)
 *     smiC._bonds.append(smiN)
 *     reseau.addtokenrow([smi])             # <<<<<<<<<<<<<<
 * 
 *     reseau.addtokenrow([smiN, smiO])
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addtokenrow); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":597
 *     reseau.addtokenrow([smi])
 * 
 *     reseau.addtokenrow([smiN, smiO])             # <<<<<<<<<<<<<<
 *     reseau.addtokenrow([smiC])
 *     reseau.saveModel(nomFichierCNO)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addtokenrow); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiO); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":598
 * 
 *     reseau.addtokenrow([smiN, smiO])
 *     reseau.addtokenrow([smiC])             # <<<<<<<<<<<<<<
 *     reseau.saveModel(nomFichierCNO)
 *     print("saved", nomFichierCNO)
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_addtokenrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":599
 *     reseau.addtokenrow([smiN, smiO])
 *     reseau.addtokenrow([smiC])
 *     reseau.saveModel(nomFichierCNO)             # <<<<<<<<<<<<<<
 *     print("saved", nomFichierCNO)
 *     print()
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_reseau); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_saveModel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_nomFichierCNO); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":600
 *     reseau.addtokenrow([smiC])
 *     reseau.saveModel(nomFichierCNO)
 *     print("saved", nomFichierCNO)             # <<<<<<<<<<<<<<
 *     print()
 *     print(GMWorshop.addtokenrow.__doc__)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_nomFichierCNO); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_n_u_saved);
    __Pyx_GIVEREF(__pyx_n_u_saved);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_saved);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":601
 *     reseau.saveModel(nomFichierCNO)
 *     print("saved", nomFichierCNO)
 *     print()             # <<<<<<<<<<<<<<
 *     print(GMWorshop.addtokenrow.__doc__)
 *     #print GMWorshop._specialisermodele.__doc__
 */
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_builtin_print); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":602
 *     print("saved", nomFichierCNO)
 *     print()
 *     print(GMWorshop.addtokenrow.__doc__)             # <<<<<<<<<<<<<<
 *     #print GMWorshop._specialisermodele.__doc__
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_GMWorshop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_addtokenrow); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/graphmachineworkshop.py":547
 * 
 * #===============================================================================
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     #p rint help(GMWorshop)
 *     import os
 */
  }

  /* "metaphor/chem_gm/core/graphmachineworkshop.py":1
 * # -*- coding: iso-8859-15 -*-             # <<<<<<<<<<<<<<
 * #===============================================================================
 * # $Id: graphmachineworkshop.py 4238 2016-09-27 11:27:39Z jeanluc $
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init metaphor.chem_gm.core.graphmachineworkshop", 0, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init metaphor.chem_gm.core.graphmachineworkshop");
  }
  __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;
}

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

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

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

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

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

/* GetItemInt */
      static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
      #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* IterFinish */
      static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* PyObjectCallMethod0 */
      static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
      static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
      static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck */
      static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* RaiseNoneIterError */
      static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
      static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
      static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
      static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

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

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

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

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

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

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

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

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

/* PyObjectFormat */
        #if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

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

/* None */
        static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyErrFetchRestore */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
        #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (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

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

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

/* ImportFrom */
        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
        static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
        static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

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

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

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

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