/* Generated by Cython 0.28.5 */

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

/*--- Type declarations ---*/
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen;
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;
struct __pyx_defaults {
  PyObject *__pyx_arg_markatom;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_isoalgo;
  PyObject *__pyx_arg_fullH;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_isoalgo;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_atoms;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_special;
};

/* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles {
  PyObject_HEAD
  PyObject *__pyx_v_lst;
  PyObject *__pyx_v_markatom;
};


/* "metaphor/chem_gm/core/metamolecule.py":140
 *     else:
 *         lst = mol
 *     toklst = (tok for tok in lst if tok.symbol in markatom)             # <<<<<<<<<<<<<<
 *     res = []
 *     for tok in toklst:
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *__pyx_outer_scope;
  PyObject *__pyx_v_tok;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "metaphor/chem_gm/core/metamolecule.py":385
 *         self.invalid = True
 *         # normalisation des chiral
 *         lst = (tok for tok in self if tok.chiral)             # <<<<<<<<<<<<<<
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *__pyx_outer_scope;
  PyObject *__pyx_v_tok;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write {
  PyObject_HEAD
  PyObject *__pyx_v_atoms;
  PyObject *__pyx_v_bonds;
};


/* "metaphor/chem_gm/core/metamolecule.py":583
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))             # <<<<<<<<<<<<<<
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))
 * #                     ff.write("\n")
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *__pyx_outer_scope;
  PyObject *__pyx_v_val;
};


/* "metaphor/chem_gm/core/metamolecule.py":584
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))             # <<<<<<<<<<<<<<
 * #                     ff.write("\n")
 * 
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *__pyx_outer_scope;
  PyObject *__pyx_v_val;
};


/* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom {
  PyObject_HEAD
  PyObject *__pyx_v_centraux;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_self;
};


/* "metaphor/chem_gm/core/metamolecule.py":804
 *             return None
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)             # <<<<<<<<<<<<<<
 *         if not cmax:
 *             return self.__smitokens[0]
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *__pyx_outer_scope;
  PyObject *__pyx_v_tok;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/chem_gm/core/metamolecule.py":884
 * 
 * #-------------------------------------------------------------------------------
 *     def atomgen(self, singleton=True): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen {
  PyObject_HEAD
  PyObject *__pyx_v_already;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_singleton;
  PyObject *__pyx_v_tok;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "metaphor/chem_gm/core/metamolecule.py":915
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 *     def bonds(self):             # <<<<<<<<<<<<<<
 *         """generator of the bonds
 *         """
 */
struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds {
  PyObject_HEAD
  PyObject *__pyx_v_bond;
  PyObject *__pyx_v_mem;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_tok;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


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

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

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

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

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

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
#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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/* Module declarations from 'metaphor.chem_gm.core.metamolecule' */
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen = 0;
static PyTypeObject *__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds = 0;
#define __Pyx_MODULE_NAME "metaphor.chem_gm.core.metamolecule"
extern int __pyx_module_is_main_metaphor__chem_gm__core__metamolecule;
int __pyx_module_is_main_metaphor__chem_gm__core__metamolecule = 0;

/* Implementation of 'metaphor.chem_gm.core.metamolecule' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_any;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_filter;
static PyObject *__pyx_builtin_map;
static const char __pyx_k_[] = "";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_V[] = "V";
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_s[] = "\t(%s)\n";
static const char __pyx_k_GC[] = "GC";
static const char __pyx_k__2[] = ": ";
static const char __pyx_k__3[] = ", ";
static const char __pyx_k__4[] = "-";
static const char __pyx_k__5[] = "\n\t";
static const char __pyx_k__7[] = "\n";
static const char __pyx_k_bb[] = "bb";
static const char __pyx_k_ff[] = "ff";
static const char __pyx_k_ll[] = "ll";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_nx[] = "nx";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_st[] = "st";
static const char __pyx_k_t1[] = "t1";
static const char __pyx_k_t2[] = "t2";
static const char __pyx_k_tl[] = "tl";
static const char __pyx_k__16[] = ",";
static const char __pyx_k__17[] = "(";
static const char __pyx_k__18[] = ") ";
static const char __pyx_k__58[] = "_";
static const char __pyx_k_any[] = "any";
static const char __pyx_k_cur[] = "cur";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_err[] = "err";
static const char __pyx_k_ind[] = "ind";
static const char __pyx_k_iso[] = "_iso";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_kwd[] = "kwd";
static const char __pyx_k_len[] = "__len__";
static const char __pyx_k_lex[] = "lex";
static const char __pyx_k_loc[] = "loc";
static const char __pyx_k_lst[] = "lst";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_mem[] = "mem";
static const char __pyx_k_mol[] = "mol";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_par[] = "par";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = ", pos: ";
static const char __pyx_k_raw[] = "raw";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_six[] = "six";
static const char __pyx_k_smi[] = "smi";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tg1[] = "tg1";
static const char __pyx_k_tg2[] = "tg2";
static const char __pyx_k_tok[] = "tok";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_Htok[] = "Htok";
static const char __pyx_k_Madj[] = "Madj";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_argv[] = "argv";
static const char __pyx_k_atom[] = "atom";
static const char __pyx_k_blst[] = "blst";
static const char __pyx_k_bond[] = "bond";
static const char __pyx_k_clst[] = "clst";
static const char __pyx_k_cmax[] = "cmax";
static const char __pyx_k_cmin[] = "cmin";
static const char __pyx_k_cond[] = "cond";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dist[] = "dist";
static const char __pyx_k_dlst[] = "dlst";
static const char __pyx_k_dmax[] = "dmax";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_elmt[] = "elmt";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_last[] = "last";
static const char __pyx_k_line[] = ", line: ";
static const char __pyx_k_lsti[] = "lsti";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mark[] = "mark";
static const char __pyx_k_mass[] = "mass";
static const char __pyx_k_name[] = ", name: ";
static const char __pyx_k_pair[] = "pair";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_res2[] = "res2";
static const char __pyx_k_res3[] = "res3";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_setH[] = "setH";
static const char __pyx_k_sort[] = "sort";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_tok2[] = "tok2";
static const char __pyx_k_yacc[] = "yacc";
static const char __pyx_k_Graph[] = "Graph";
static const char __pyx_k_MDist[] = "MDist";
static const char __pyx_k_Mnadj[] = "Mnadj";
static const char __pyx_k_atoms[] = "atoms";
static const char __pyx_k_bond1[] = "bond1";
static const char __pyx_k_bond2[] = "bond2";
static const char __pyx_k_bonds[] = "bonds";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_conds[] = "conds";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_cumul[] = "cumul";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_equiv[] = "equiv";
static const char __pyx_k_found[] = "found";
static const char __pyx_k_fullH[] = "fullH";
static const char __pyx_k_grade[] = "grade";
static const char __pyx_k_graph[] = "_graph";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_isInt[] = "isInt";
static const char __pyx_k_iso_2[] = "iso";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_level[] = "level";
static const char __pyx_k_lexer[] = "lexer";
static const char __pyx_k_mkdir[] = "mkdir";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_parse[] = "parse";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_sname[] = "sname";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_type0[] = "type0";
static const char __pyx_k_type1[] = "type1";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_Cycles[] = "\nCycles :\n";
static const char __pyx_k_OKDraw[] = "OKDraw";
static const char __pyx_k_action[] = "action";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_asBond[] = "asBond";
static const char __pyx_k_atomss[] = "atomss";
static const char __pyx_k_bestof[] = "bestof";
static const char __pyx_k_bondss[] = "bondss";
static const char __pyx_k_broken[] = "broken";
static const char __pyx_k_cbonds[] = "cbonds";
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_common[] = "common";
static const char __pyx_k_cycles[] = "cycles";
static const char __pyx_k_dbllst[] = "dbllst";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_filter[] = "filter";
static const char __pyx_k_hcount[] = "_hcount";
static const char __pyx_k_holder[] = "holder";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_islice[] = "islice";
static const char __pyx_k_isokey[] = "isokey";
static const char __pyx_k_isoloc[] = "isoloc";
static const char __pyx_k_isomax[] = "isomax";
static const char __pyx_k_keyinv[] = "keyinv";
static const char __pyx_k_lexpos[] = "lexpos";
static const char __pyx_k_lextab[] = "lextab";
static const char __pyx_k_line_2[] = " line: ";
static const char __pyx_k_lstloc[] = "lstloc";
static const char __pyx_k_module[] = "module";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_name_3[] = "__name__";
static const char __pyx_k_numero[] = "numero";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_occurs[] = "occurs";
static const char __pyx_k_parser[] = "parser";
static const char __pyx_k_prefix[] = "prefix";
static const char __pyx_k_rawiso[] = "rawiso";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_resloc[] = "resloc";
static const char __pyx_k_smiles[] = "smiles";
static const char __pyx_k_smilex[] = "smilex";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_symbol[] = "symbol";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_test_2[] = "__test__";
static const char __pyx_k_toklst[] = "toklst";
static const char __pyx_k_unichr[] = "unichr";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_writer[] = "writer";
static const char __pyx_k_APPNAME[] = "APPNAME";
static const char __pyx_k_already[] = "already";
static const char __pyx_k_analyse[] = "analyse";
static const char __pyx_k_atomgen[] = "atomgen";
static const char __pyx_k_atomlst[] = "atomlst";
static const char __pyx_k_bonds_2[] = "_bonds";
static const char __pyx_k_central[] = "central";
static const char __pyx_k_chem_gm[] = "chem_gm";
static const char __pyx_k_counted[] = "counted";
static const char __pyx_k_delitem[] = "__delitem__";
static const char __pyx_k_distmax[] = "distmax";
static const char __pyx_k_distsum[] = "distsum";
static const char __pyx_k_dmaxlst[] = "dmaxlst";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getdiff[] = "getdiff";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_gmutils[] = "gmutils";
static const char __pyx_k_graph_2[] = "graph";
static const char __pyx_k_indList[] = "indList";
static const char __pyx_k_invalid[] = "invalid";
static const char __pyx_k_isoalgo[] = "isoalgo";
static const char __pyx_k_itermax[] = "itermax";
static const char __pyx_k_lexline[] = "lexline";
static const char __pyx_k_massmem[] = "massmem";
static const char __pyx_k_max_map[] = "max_map";
static const char __pyx_k_maxiter[] = "maxiter";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_moltest[] = "moltest";
static const char __pyx_k_ordered[] = "ordered";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_reduced[] = "reduced";
static const char __pyx_k_setitem[] = "__setitem__";
static const char __pyx_k_special[] = "special";
static const char __pyx_k_valence[] = "valence";
static const char __pyx_k_verbose[] = "verbose";
static const char __pyx_k_written[] = "written";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Property[] = "Property";
static const char __pyx_k_SmiError[] = "SmiError";
static const char __pyx_k_SmiToken[] = "SmiToken";
static const char __pyx_k_add_edge[] = "add_edge";
static const char __pyx_k_adj2dist[] = "adj2dist";
static const char __pyx_k_aromatic[] = "aromatic";
static const char __pyx_k_bondType[] = "bondType";
static const char __pyx_k_broken_2[] = "_broken";
static const char __pyx_k_centraux[] = "centraux";
static const char __pyx_k_condbond[] = "condbond";
static const char __pyx_k_cycleloc[] = "cycleloc";
static const char __pyx_k_datatest[] = "datatest";
static const char __pyx_k_delegate[] = "delegate";
static const char __pyx_k_dmmaxmax[] = "dmmaxmax";
static const char __pyx_k_docreate[] = "docreate";
static const char __pyx_k_docycles[] = "docycles";
static const char __pyx_k_excluded[] = "excluded";
static const char __pyx_k_gradekey[] = "gradekey";
static const char __pyx_k_gradeloc[] = "gradeloc";
static const char __pyx_k_hcount_2[] = "hcount";
static const char __pyx_k_isSmiles[] = "isSmiles";
static const char __pyx_k_isomeric[] = "isomeric";
static const char __pyx_k_isooccur[] = "isooccur";
static const char __pyx_k_kekulize[] = "kekulize";
static const char __pyx_k_keyAtoms[] = "keyAtoms";
static const char __pyx_k_linkedto[] = "linkedto";
static const char __pyx_k_markatom[] = "markatom";
static const char __pyx_k_missingH[] = "missingH";
static const char __pyx_k_module_2[] = "__module__";
static const char __pyx_k_networkx[] = "networkx";
static const char __pyx_k_numero_2[] = "_numero";
static const char __pyx_k_optimize[] = "optimize";
static const char __pyx_k_outstyle[] = "outstyle";
static const char __pyx_k_printAll[] = "printAll";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rawiso_2[] = "_rawiso";
static const char __pyx_k_reversed[] = "__reversed__";
static const char __pyx_k_sequence[] = "sequence";
static const char __pyx_k_setGraph[] = "setGraph";
static const char __pyx_k_skeleton[] = "skeleton";
static const char __pyx_k_smilexer[] = "smilexer";
static const char __pyx_k_toSmiles[] = "toSmiles";
static const char __pyx_k_withname[] = "withname";
static const char __pyx_k_ISOALGO_0[] = "ISOALGO_0";
static const char __pyx_k_applidata[] = "applidata";
static const char __pyx_k_atomoccur[] = "atomoccur";
static const char __pyx_k_bondOrder[] = "bondOrder";
static const char __pyx_k_chargekey[] = "chargekey";
static const char __pyx_k_chiralloc[] = "chiralloc";
static const char __pyx_k_chiralmax[] = "chiralmax";
static const char __pyx_k_condbonds[] = "condbonds";
static const char __pyx_k_cycleends[] = "cycleends";
static const char __pyx_k_cyclelist[] = "cyclelist";
static const char __pyx_k_distances[] = "_distances";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_errortype[] = "errortype";
static const char __pyx_k_existingH[] = "existingH";
static const char __pyx_k_getBondTo[] = "getBondTo";
static const char __pyx_k_getSmiles[] = "getSmiles";
static const char __pyx_k_hasbondto[] = "hasbondto";
static const char __pyx_k_indexOnly[] = "indexOnly";
static const char __pyx_k_indexlist[] = "indexlist";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_modelname[] = "modelname";
static const char __pyx_k_occurmols[] = "occurmols";
static const char __pyx_k_occursloc[] = "occursloc";
static const char __pyx_k_outputdir[] = "outputdir";
static const char __pyx_k_ringmodel[] = "_ringmodel";
static const char __pyx_k_singleton[] = "singleton";
static const char __pyx_k_smilextab[] = "smilextab";
static const char __pyx_k_smitokens[] = "smitokens";
static const char __pyx_k_special_2[] = "_special";
static const char __pyx_k_terminals[] = "terminals";
static const char __pyx_k_withindex[] = "withindex";
static const char __pyx_k_12absolute[] = "_12absolute";
static const char __pyx_k_Hydrogenes[] = "Hydrogenes";
static const char __pyx_k_appdatadir[] = "appdatadir";
static const char __pyx_k_aromatic_2[] = "_aromatic";
static const char __pyx_k_atomicMass[] = "_atomicMass";
static const char __pyx_k_chargelist[] = "chargelist";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_edges_attr[] = "edges_attr";
static const char __pyx_k_equivalent[] = "equivalent";
static const char __pyx_k_findinlist[] = "findinlist";
static const char __pyx_k_gradeoccur[] = "gradeoccur";
static const char __pyx_k_indListmem[] = "indListmem";
static const char __pyx_k_picklefile[] = "picklefile";
static const char __pyx_k_rawisolist[] = "rawisolist";
static const char __pyx_k_ringsmiles[] = "_ringsmiles";
static const char __pyx_k_setcbondto[] = "setcbondto";
static const char __pyx_k_startindex[] = "startindex";
static const char __pyx_k_DOUBLE_BOND[] = "DOUBLE_BOND";
static const char __pyx_k_SINGLE_BOND[] = "SINGLE_BOND";
static const char __pyx_k_chiraloccur[] = "chiraloccur";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_commonBonds[] = "commonBonds";
static const char __pyx_k_commonbonds[] = "commonbonds";
static const char __pyx_k_cycle_basis[] = "cycle_basis";
static const char __pyx_k_defaultdict[] = "defaultdict";
static const char __pyx_k_distances_2[] = "distances";
static const char __pyx_k_getskeleton[] = "getskeleton";
static const char __pyx_k_gmconstants[] = "gmconstants";
static const char __pyx_k_indListTest[] = "indListTest";
static const char __pyx_k_isolatediso[] = "isolatediso";
static const char __pyx_k_modelbroken[] = "modelbroken";
static const char __pyx_k_outputindex[] = "outputindex";
static const char __pyx_k_postprocess[] = "postprocess";
static const char __pyx_k_smitokens_2[] = "__smitokens";
static const char __pyx_k_tokringdict[] = "tokringdict";
static const char __pyx_k_tokringlist[] = "tokringlist";
static const char __pyx_k_withIndList[] = "withIndList";
static const char __pyx_k_ISOALGO_PAIR[] = "ISOALGO_PAIR";
static const char __pyx_k_MetaMolecule[] = "MetaMolecule";
static const char __pyx_k_aromaticterm[] = "aromaticterm";
static const char __pyx_k_chem_gm_core[] = "chem_gm.core";
static const char __pyx_k_clearbrokens[] = "clearbrokens";
static const char __pyx_k_graphmachine[] = "graphmachine";
static const char __pyx_k_keyForChiral[] = "keyForChiral";
static const char __pyx_k_occurmolsloc[] = "occurmolsloc";
static const char __pyx_k_rawisogroups[] = "rawisogroups";
static const char __pyx_k_stableSmiles[] = "stableSmiles";
static const char __pyx_k_AROMATIC_BOND[] = "AROMATIC_BOND";
static const char __pyx_k_SmiCycleError[] = "SmiCycleError";
static const char __pyx_k_coupurecycles[] = "coupurecycles";
static const char __pyx_k_distanceIndex[] = "distanceIndex";
static const char __pyx_k_getChargeList[] = "getChargeList";
static const char __pyx_k_includebroken[] = "includebroken";
static const char __pyx_k_isolatedindex[] = "isolatedindex";
static const char __pyx_k_keyForClosure[] = "keyForClosure";
static const char __pyx_k_modelbroken_2[] = "_modelbroken";
static const char __pyx_k_smiparserspec[] = "smiparserspec";
static const char __pyx_k_splitIsoGroup[] = "splitIsoGroup";
static const char __pyx_k_squaredistmax[] = "squaredistmax";
static const char __pyx_k_sqyaredistsum[] = "sqyaredistsum";
static const char __pyx_k_tokenKeyValue[] = "tokenKeyValue";
static const char __pyx_k_ReduceIsoGroup[] = "ReduceIsoGroup";
static const char __pyx_k_absolutechiral[] = "_absolutechiral";
static const char __pyx_k_equivalentList[] = "equivalentList";
static const char __pyx_k_fragmentweight[] = "fragmentweight";
static const char __pyx_k_getBrokenBonds[] = "getBrokenBonds";
static const char __pyx_k_getCentralAtom[] = "getCentralAtom";
static const char __pyx_k_getEquivalents[] = "getEquivalents";
static const char __pyx_k_getReducedList[] = "getReducedList";
static const char __pyx_k_getSmilesStart[] = "getSmilesStart";
static const char __pyx_k_isoalgodefault[] = "isoalgodefault";
static const char __pyx_k_m_toluic_acid0[] = "m_toluic acid0";
static const char __pyx_k_monal_Property[] = "monal.Property";
static const char __pyx_k_ringClosureMax[] = "ringClosureMax";
static const char __pyx_k_withoccurences[] = "withoccurences";
static const char __pyx_k_SmilesToCanonic[] = "SmilesToCanonic";
static const char __pyx_k_analyseinitiale[] = "_analyseinitiale";
static const char __pyx_k_distanceIndex_2[] = "_distanceIndex";
static const char __pyx_k_normalizeChiral[] = "normalizeChiral";
static const char __pyx_k_singleterminals[] = "singleterminals";
static const char __pyx_k_smiparsetab_pyl[] = "smiparsetab.pyl";
static const char __pyx_k_stabilizeSmiles[] = "stabilizeSmiles";
static const char __pyx_k_SmileParserError[] = "SmileParserError";
static const char __pyx_k_addClassToSmiles[] = "addClassToSmiles";
static const char __pyx_k_computedistances[] = "computedistances";
static const char __pyx_k_monal_util_utils[] = "monal.util.utils";
static const char __pyx_k_normalizeNumeros[] = "normalizeNumeros";
static const char __pyx_k_MetaMolecule_mass[] = "MetaMolecule.mass";
static const char __pyx_k_clearModelBrokens[] = "clearModelBrokens";
static const char __pyx_k_closureCandidates[] = "closureCandidates";
static const char __pyx_k_MetaMolecule_bonds[] = "MetaMolecule.bonds";
static const char __pyx_k_MetaMolecule_graph[] = "MetaMolecule.graph";
static const char __pyx_k_MetaMolecule_write[] = "MetaMolecule.write";
static const char __pyx_k_chem_gm_core_atoms[] = "chem_gm.core.atoms";
static const char __pyx_k_chem_gm_core_bonds[] = "chem_gm.core.bonds";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_monal_util_toolbox[] = "monal.util.toolbox";
static const char __pyx_k_MetaMolecule___init[] = "MetaMolecule.__init__";
static const char __pyx_k_MetaMolecule_cycles[] = "MetaMolecule.cycles";
static const char __pyx_k_MetaMolecule_remove[] = "MetaMolecule.remove";
static const char __pyx_k_Smiles_parser_Error[] = "Smiles parser Error";
static const char __pyx_k_get_edge_attributes[] = "get_edge_attributes";
static const char __pyx_k_populatebrokenbonds[] = "populatebrokenbonds";
static const char __pyx_k_recreatebrokenbonds[] = "recreatebrokenbonds";
static const char __pyx_k_MetaMolecule_analyse[] = "MetaMolecule.analyse";
static const char __pyx_k_MetaMolecule_atomgen[] = "MetaMolecule.atomgen";
static const char __pyx_k_MetaMolecule_getdiff[] = "MetaMolecule.getdiff";
static const char __pyx_k_SmileParserError_msg[] = "SmileParserError.msg";
static const char __pyx_k_chem_gm_core_gmutils[] = "chem_gm.core.gmutils";
static const char __pyx_k_tallyDistanceIndexes[] = "tallyDistanceIndexes";
static const char __pyx_k_Cc1cc_C_O_O_ccc_H_1_1[] = "Cc1cc(C(O)=O)ccc([H:1])1";
static const char __pyx_k_MetaMolecule_kekulize[] = "MetaMolecule.kekulize";
static const char __pyx_k_MetaMolecule_printAll[] = "MetaMolecule.printAll";
static const char __pyx_k_MetaMolecule_setGraph[] = "MetaMolecule.setGraph";
static const char __pyx_k_computedistancesindex[] = "computedistancesindex";
static const char __pyx_k_MetaMolecule_getSmiles[] = "MetaMolecule.getSmiles";
static const char __pyx_k_chem_gm_core_smitokens[] = "chem_gm.core.smitokens";
static const char __pyx_k_MetaMolecule__smitokens[] = "_MetaMolecule__smitokens";
static const char __pyx_k_SmileParserError___init[] = "SmileParserError.__init__";
static const char __pyx_k_MetaMolecule_getskeleton[] = "MetaMolecule.getskeleton";
static const char __pyx_k_MetaMolecule_postprocess[] = "MetaMolecule.postprocess";
static const char __pyx_k_MetaMolecule_clearbrokens[] = "MetaMolecule.clearbrokens";
static const char __pyx_k_MetaMolecule_getChargeList[] = "MetaMolecule.getChargeList";
static const char __pyx_k_MetaMolecule_splitIsoGroup[] = "MetaMolecule.splitIsoGroup";
static const char __pyx_k_Exception_in_SMILES_parsing[] = "Exception in SMILES parsing\n    ";
static const char __pyx_k_Exception_in_cycle_analysis[] = "Exception in cycle analysis\n    ";
static const char __pyx_k_MetaMolecule_ReduceIsoGroup[] = "MetaMolecule.ReduceIsoGroup";
static const char __pyx_k_MetaMolecule_equivalentList[] = "MetaMolecule.equivalentList";
static const char __pyx_k_MetaMolecule_getBrokenBonds[] = "MetaMolecule.getBrokenBonds";
static const char __pyx_k_MetaMolecule_getCentralAtom[] = "MetaMolecule.getCentralAtom";
static const char __pyx_k_MetaMolecule_getEquivalents[] = "MetaMolecule.getEquivalents";
static const char __pyx_k_MetaMolecule_getReducedList[] = "MetaMolecule.getReducedList";
static const char __pyx_k_MetaMolecule_getSmilesStart[] = "MetaMolecule.getSmilesStart";
static const char __pyx_k_MetaMolecule_ringClosureMax[] = "MetaMolecule.ringClosureMax";
static const char __pyx_k_MetaMolecule__analyseinitiale[] = "MetaMolecule._analyseinitiale";
static const char __pyx_k_MetaMolecule_computedistances[] = "MetaMolecule.computedistances";
static const char __pyx_k_MetaMolecule_normalizeNumeros[] = "MetaMolecule.normalizeNumeros";
static const char __pyx_k_MetaMolecule_clearModelBrokens[] = "MetaMolecule.clearModelBrokens";
static const char __pyx_k_MetaMolecule_closureCandidates[] = "MetaMolecule.closureCandidates";
static const char __pyx_k_Definition_of_MetaMolecule_clas[] = "\nDefinition of MetaMolecule class.\n\nuse SMILES specification in \"opensmiles.org\"\n\n";
static const char __pyx_k_MetaMolecule_postprocess_locals[] = "MetaMolecule.postprocess.<locals>.genexpr";
static const char __pyx_k_addClassToSmiles_locals_genexpr[] = "addClassToSmiles.<locals>.genexpr";
static const char __pyx_k_MetaMolecule__analyseinitiale_lo[] = "MetaMolecule._analyseinitiale.<locals>.<lambda>";
static const char __pyx_k_MetaMolecule_analyse_locals_lamb[] = "MetaMolecule.analyse.<locals>.<lambda>";
static const char __pyx_k_MetaMolecule_cycles_locals_lambd[] = "MetaMolecule.cycles.<locals>.<lambda>";
static const char __pyx_k_MetaMolecule_getCentralAtom_loca[] = "MetaMolecule.getCentralAtom.<locals>.genexpr";
static const char __pyx_k_MetaMolecule_getSmilesStart_loca[] = "MetaMolecule.getSmilesStart.<locals>.<lambda>";
static const char __pyx_k_MetaMolecule_recreatebrokenbonds[] = "MetaMolecule.recreatebrokenbonds";
static const char __pyx_k_MetaMolecule_tallyDistanceIndexe[] = "MetaMolecule.tallyDistanceIndexes";
static const char __pyx_k_MetaMolecule_write_locals_genexp[] = "MetaMolecule.write.<locals>.genexpr";
static const char __pyx_k_class_MetaMolecule_This_class_us[] = "class MetaMolecule. \n    This class uses the PLY based lexer and parser.\n    The attribute __smitokens holds a list of smitoken objects. Some of the \n    attributes of the list are delegated to the class MetaMolecule.\n    ";
static const char __pyx_k_metaphor_chem_gm_core_metamolecu[] = "metaphor.chem_gm.core.metamolecule";
static const char __pyx_k_MetaMolecule_getCentralAtom_loca_2[] = "MetaMolecule.getCentralAtom.<locals>.<lambda>";
static const char __pyx_k_metaphor_chem_gm_core_metamolecu_2[] = "metaphor/chem_gm/core/metamolecule.py";
static PyObject *__pyx_n_s_;
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_12absolute;
static PyObject *__pyx_n_s_APPNAME;
static PyObject *__pyx_n_s_AROMATIC_BOND;
static PyObject *__pyx_n_u_C;
static PyObject *__pyx_kp_u_Cc1cc_C_O_O_ccc_H_1_1;
static PyObject *__pyx_kp_u_Cycles;
static PyObject *__pyx_n_s_DOUBLE_BOND;
static PyObject *__pyx_kp_s_Exception_in_SMILES_parsing;
static PyObject *__pyx_kp_s_Exception_in_cycle_analysis;
static PyObject *__pyx_n_s_GC;
static PyObject *__pyx_n_s_Graph;
static PyObject *__pyx_n_u_H;
static PyObject *__pyx_n_s_Htok;
static PyObject *__pyx_n_s_Hydrogenes;
static PyObject *__pyx_n_s_ISOALGO_0;
static PyObject *__pyx_n_s_ISOALGO_PAIR;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_MDist;
static PyObject *__pyx_n_s_Madj;
static PyObject *__pyx_n_s_MetaMolecule;
static PyObject *__pyx_n_s_iso885915_MetaMolecule;
static PyObject *__pyx_n_s_MetaMolecule_ReduceIsoGroup;
static PyObject *__pyx_n_s_MetaMolecule___init;
static PyObject *__pyx_n_s_MetaMolecule__analyseinitiale;
static PyObject *__pyx_n_s_MetaMolecule__analyseinitiale_lo;
static PyObject *__pyx_n_s_MetaMolecule__smitokens;
static PyObject *__pyx_n_s_MetaMolecule_analyse;
static PyObject *__pyx_n_s_MetaMolecule_analyse_locals_lamb;
static PyObject *__pyx_n_s_MetaMolecule_atomgen;
static PyObject *__pyx_n_s_MetaMolecule_bonds;
static PyObject *__pyx_n_s_MetaMolecule_clearModelBrokens;
static PyObject *__pyx_n_s_MetaMolecule_clearbrokens;
static PyObject *__pyx_n_s_MetaMolecule_closureCandidates;
static PyObject *__pyx_n_s_MetaMolecule_computedistances;
static PyObject *__pyx_n_s_MetaMolecule_cycles;
static PyObject *__pyx_n_s_MetaMolecule_cycles_locals_lambd;
static PyObject *__pyx_n_s_MetaMolecule_equivalentList;
static PyObject *__pyx_n_s_MetaMolecule_getBrokenBonds;
static PyObject *__pyx_n_s_MetaMolecule_getCentralAtom;
static PyObject *__pyx_n_s_MetaMolecule_getCentralAtom_loca;
static PyObject *__pyx_n_s_MetaMolecule_getCentralAtom_loca_2;
static PyObject *__pyx_n_s_MetaMolecule_getChargeList;
static PyObject *__pyx_n_s_MetaMolecule_getEquivalents;
static PyObject *__pyx_n_s_MetaMolecule_getReducedList;
static PyObject *__pyx_n_s_MetaMolecule_getSmiles;
static PyObject *__pyx_n_s_MetaMolecule_getSmilesStart;
static PyObject *__pyx_n_s_MetaMolecule_getSmilesStart_loca;
static PyObject *__pyx_n_s_MetaMolecule_getdiff;
static PyObject *__pyx_n_s_MetaMolecule_getskeleton;
static PyObject *__pyx_n_s_MetaMolecule_graph;
static PyObject *__pyx_n_s_MetaMolecule_kekulize;
static PyObject *__pyx_n_s_MetaMolecule_mass;
static PyObject *__pyx_n_s_MetaMolecule_normalizeNumeros;
static PyObject *__pyx_n_s_MetaMolecule_postprocess;
static PyObject *__pyx_n_s_MetaMolecule_postprocess_locals;
static PyObject *__pyx_n_s_MetaMolecule_printAll;
static PyObject *__pyx_n_s_MetaMolecule_recreatebrokenbonds;
static PyObject *__pyx_n_s_MetaMolecule_remove;
static PyObject *__pyx_n_s_MetaMolecule_ringClosureMax;
static PyObject *__pyx_n_s_MetaMolecule_setGraph;
static PyObject *__pyx_n_s_MetaMolecule_splitIsoGroup;
static PyObject *__pyx_n_s_MetaMolecule_tallyDistanceIndexe;
static PyObject *__pyx_n_s_MetaMolecule_write;
static PyObject *__pyx_n_s_MetaMolecule_write_locals_genexp;
static PyObject *__pyx_n_s_Mnadj;
static PyObject *__pyx_n_s_OKDraw;
static PyObject *__pyx_n_s_Property;
static PyObject *__pyx_n_s_ReduceIsoGroup;
static PyObject *__pyx_n_s_SINGLE_BOND;
static PyObject *__pyx_n_s_SmiCycleError;
static PyObject *__pyx_n_s_iso885915_SmiCycleError;
static PyObject *__pyx_n_s_SmiError;
static PyObject *__pyx_n_s_SmiToken;
static PyObject *__pyx_n_s_SmileParserError;
static PyObject *__pyx_n_s_iso885915_SmileParserError;
static PyObject *__pyx_n_s_SmileParserError___init;
static PyObject *__pyx_n_s_SmileParserError_msg;
static PyObject *__pyx_n_s_SmilesToCanonic;
static PyObject *__pyx_kp_u_Smiles_parser_Error;
static PyObject *__pyx_n_s_V;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__18;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_n_s__58;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_n_s_absolutechiral;
static PyObject *__pyx_n_s_action;
static PyObject *__pyx_n_s_addClassToSmiles;
static PyObject *__pyx_n_s_addClassToSmiles_locals_genexpr;
static PyObject *__pyx_n_s_add_edge;
static PyObject *__pyx_n_s_adj2dist;
static PyObject *__pyx_n_s_already;
static PyObject *__pyx_n_s_analyse;
static PyObject *__pyx_n_s_analyseinitiale;
static PyObject *__pyx_n_s_any;
static PyObject *__pyx_n_s_appdatadir;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_u_append;
static PyObject *__pyx_n_s_applidata;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_argv;
static PyObject *__pyx_n_s_aromatic;
static PyObject *__pyx_n_s_aromatic_2;
static PyObject *__pyx_n_s_aromaticterm;
static PyObject *__pyx_n_s_asBond;
static PyObject *__pyx_n_s_atom;
static PyObject *__pyx_n_s_atomgen;
static PyObject *__pyx_n_s_atomicMass;
static PyObject *__pyx_n_s_atomlst;
static PyObject *__pyx_n_s_atomoccur;
static PyObject *__pyx_n_s_atoms;
static PyObject *__pyx_n_s_atomss;
static PyObject *__pyx_n_s_bb;
static PyObject *__pyx_n_s_bestof;
static PyObject *__pyx_n_s_blst;
static PyObject *__pyx_n_s_bond;
static PyObject *__pyx_n_u_bond;
static PyObject *__pyx_n_s_bond1;
static PyObject *__pyx_n_s_bond2;
static PyObject *__pyx_n_s_bondOrder;
static PyObject *__pyx_n_s_bondType;
static PyObject *__pyx_n_s_bonds;
static PyObject *__pyx_n_s_bonds_2;
static PyObject *__pyx_n_s_bondss;
static PyObject *__pyx_n_s_broken;
static PyObject *__pyx_n_s_broken_2;
static PyObject *__pyx_n_s_cbonds;
static PyObject *__pyx_n_s_central;
static PyObject *__pyx_n_s_centraux;
static PyObject *__pyx_n_s_charge;
static PyObject *__pyx_n_s_chargekey;
static PyObject *__pyx_n_s_chargelist;
static PyObject *__pyx_n_s_chem_gm;
static PyObject *__pyx_n_s_chem_gm_core;
static PyObject *__pyx_n_s_chem_gm_core_atoms;
static PyObject *__pyx_n_s_chem_gm_core_bonds;
static PyObject *__pyx_n_s_chem_gm_core_gmutils;
static PyObject *__pyx_n_s_chem_gm_core_smitokens;
static PyObject *__pyx_n_s_chikey;
static PyObject *__pyx_n_s_chiral;
static PyObject *__pyx_n_s_chiralloc;
static PyObject *__pyx_n_s_chiralmax;
static PyObject *__pyx_n_s_chiraloccur;
static PyObject *__pyx_kp_s_class_MetaMolecule_This_class_us;
static PyObject *__pyx_n_s_clearModelBrokens;
static PyObject *__pyx_n_s_clearbrokens;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closureCandidates;
static PyObject *__pyx_n_s_clst;
static PyObject *__pyx_n_s_cmax;
static PyObject *__pyx_n_s_cmin;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_common;
static PyObject *__pyx_n_s_commonBonds;
static PyObject *__pyx_n_s_commonbonds;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_computedistances;
static PyObject *__pyx_n_s_computedistancesindex;
static PyObject *__pyx_n_s_cond;
static PyObject *__pyx_n_s_condbond;
static PyObject *__pyx_n_s_condbonds;
static PyObject *__pyx_n_s_conds;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_counted;
static PyObject *__pyx_n_s_coupurecycles;
static PyObject *__pyx_n_s_cumul;
static PyObject *__pyx_n_s_cur;
static PyObject *__pyx_n_s_cycle_basis;
static PyObject *__pyx_n_s_cycleends;
static PyObject *__pyx_n_s_cyclelist;
static PyObject *__pyx_n_s_cycleloc;
static PyObject *__pyx_n_s_cycles;
static PyObject *__pyx_n_u_cycles;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_datatest;
static PyObject *__pyx_n_s_dbllst;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_defaultdict;
static PyObject *__pyx_n_s_delegate;
static PyObject *__pyx_n_u_delitem;
static PyObject *__pyx_n_s_dist;
static PyObject *__pyx_n_s_distanceIndex;
static PyObject *__pyx_n_s_distanceIndex_2;
static PyObject *__pyx_n_s_distances;
static PyObject *__pyx_n_s_distances_2;
static PyObject *__pyx_n_s_distmax;
static PyObject *__pyx_n_s_distsum;
static PyObject *__pyx_n_s_dlst;
static PyObject *__pyx_n_s_dmax;
static PyObject *__pyx_n_s_dmaxlst;
static PyObject *__pyx_n_s_dmmaxmax;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_docreate;
static PyObject *__pyx_n_s_docycles;
static PyObject *__pyx_n_u_done;
static PyObject *__pyx_n_s_dot;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_edges_attr;
static PyObject *__pyx_n_s_elmt;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equiv;
static PyObject *__pyx_n_s_equivalent;
static PyObject *__pyx_n_s_equivalentList;
static PyObject *__pyx_n_s_err;
static PyObject *__pyx_n_s_errortype;
static PyObject *__pyx_n_s_excluded;
static PyObject *__pyx_n_s_existingH;
static PyObject *__pyx_n_s_exists;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_ff;
static PyObject *__pyx_n_s_filter;
static PyObject *__pyx_n_s_findinlist;
static PyObject *__pyx_n_s_found;
static PyObject *__pyx_n_s_fragmentweight;
static PyObject *__pyx_n_s_fullH;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_getBondTo;
static PyObject *__pyx_n_s_getBrokenBonds;
static PyObject *__pyx_n_s_getCentralAtom;
static PyObject *__pyx_n_s_getChargeList;
static PyObject *__pyx_n_s_getEquivalents;
static PyObject *__pyx_n_s_getReducedList;
static PyObject *__pyx_n_s_getSmiles;
static PyObject *__pyx_n_s_getSmilesStart;
static PyObject *__pyx_n_s_get_edge_attributes;
static PyObject *__pyx_n_s_getdiff;
static PyObject *__pyx_n_u_getitem;
static PyObject *__pyx_n_s_getskeleton;
static PyObject *__pyx_n_s_gmconstants;
static PyObject *__pyx_n_s_gmutils;
static PyObject *__pyx_n_s_grade;
static PyObject *__pyx_n_s_gradekey;
static PyObject *__pyx_n_s_gradeloc;
static PyObject *__pyx_n_s_gradeoccur;
static PyObject *__pyx_n_s_graph;
static PyObject *__pyx_n_s_graph_2;
static PyObject *__pyx_n_u_graphmachine;
static PyObject *__pyx_n_s_hasbondto;
static PyObject *__pyx_n_s_hcount;
static PyObject *__pyx_n_s_hcount_2;
static PyObject *__pyx_n_s_holder;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_includebroken;
static PyObject *__pyx_n_s_ind;
static PyObject *__pyx_n_s_indList;
static PyObject *__pyx_n_s_indListTest;
static PyObject *__pyx_n_s_indListmem;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_indexOnly;
static PyObject *__pyx_n_s_indexlist;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_u_insert;
static PyObject *__pyx_n_s_invalid;
static PyObject *__pyx_n_s_isInt;
static PyObject *__pyx_n_s_isSmiles;
static PyObject *__pyx_n_s_islice;
static PyObject *__pyx_n_s_iso;
static PyObject *__pyx_n_s_iso_2;
static PyObject *__pyx_n_s_isoalgo;
static PyObject *__pyx_n_s_isoalgodefault;
static PyObject *__pyx_n_s_isokey;
static PyObject *__pyx_n_s_isolatedindex;
static PyObject *__pyx_n_s_isolatediso;
static PyObject *__pyx_n_s_isoloc;
static PyObject *__pyx_n_s_isomax;
static PyObject *__pyx_n_s_isomeric;
static PyObject *__pyx_n_s_isooccur;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_u_iter;
static PyObject *__pyx_n_s_itermax;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_kekulize;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keyAtoms;
static PyObject *__pyx_n_s_keyForChiral;
static PyObject *__pyx_n_s_keyForClosure;
static PyObject *__pyx_n_s_keyinv;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwd;
static PyObject *__pyx_n_s_last;
static PyObject *__pyx_n_u_len;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_n_s_lex;
static PyObject *__pyx_n_s_lexer;
static PyObject *__pyx_n_s_lexline;
static PyObject *__pyx_n_s_lexpos;
static PyObject *__pyx_n_s_lextab;
static PyObject *__pyx_kp_u_line;
static PyObject *__pyx_kp_u_line_2;
static PyObject *__pyx_n_s_linkedto;
static PyObject *__pyx_n_s_ll;
static PyObject *__pyx_n_s_loc;
static PyObject *__pyx_n_s_lst;
static PyObject *__pyx_n_s_lsti;
static PyObject *__pyx_n_s_lstloc;
static PyObject *__pyx_kp_u_m_toluic_acid0;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_u_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mark;
static PyObject *__pyx_n_s_markatom;
static PyObject *__pyx_n_s_mass;
static PyObject *__pyx_n_s_massmem;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_max_map;
static PyObject *__pyx_n_s_maxiter;
static PyObject *__pyx_n_s_mem;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metaphor_chem_gm_core_metamolecu;
static PyObject *__pyx_kp_s_metaphor_chem_gm_core_metamolecu_2;
static PyObject *__pyx_n_s_missingH;
static PyObject *__pyx_n_s_mkdir;
static PyObject *__pyx_n_s_modelbroken;
static PyObject *__pyx_n_s_modelbroken_2;
static PyObject *__pyx_n_s_modelname;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_n_s_mol;
static PyObject *__pyx_n_s_moltest;
static PyObject *__pyx_n_s_monal_Property;
static PyObject *__pyx_n_s_monal_util_toolbox;
static PyObject *__pyx_n_s_monal_util_utils;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_kp_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_name_3;
static PyObject *__pyx_n_s_networkx;
static PyObject *__pyx_n_s_normalizeChiral;
static PyObject *__pyx_n_s_normalizeNumeros;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numero;
static PyObject *__pyx_n_s_numero_2;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_nx;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_occurmols;
static PyObject *__pyx_n_s_occurmolsloc;
static PyObject *__pyx_n_s_occurs;
static PyObject *__pyx_n_s_occursloc;
static PyObject *__pyx_n_s_optimize;
static PyObject *__pyx_n_s_ordered;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_outputdir;
static PyObject *__pyx_n_s_outputindex;
static PyObject *__pyx_n_s_outstyle;
static PyObject *__pyx_n_s_pair;
static PyObject *__pyx_n_s_par;
static PyObject *__pyx_n_s_parse;
static PyObject *__pyx_n_s_parser;
static PyObject *__pyx_n_u_parser;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_picklefile;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_u_pop;
static PyObject *__pyx_n_s_populatebrokenbonds;
static PyObject *__pyx_kp_u_pos;
static PyObject *__pyx_n_s_postprocess;
static PyObject *__pyx_n_s_prefix;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_printAll;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_raw;
static PyObject *__pyx_n_s_rawiso;
static PyObject *__pyx_n_s_rawiso_2;
static PyObject *__pyx_n_s_rawisogroups;
static PyObject *__pyx_n_s_rawisolist;
static PyObject *__pyx_n_s_recreatebrokenbonds;
static PyObject *__pyx_n_s_reduced;
static PyObject *__pyx_n_s_ref;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_res2;
static PyObject *__pyx_n_s_res3;
static PyObject *__pyx_n_s_resloc;
static PyObject *__pyx_n_u_reversed;
static PyObject *__pyx_n_s_ringClosureMax;
static PyObject *__pyx_n_s_ringmodel;
static PyObject *__pyx_n_s_ringsmiles;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_sequence;
static PyObject *__pyx_n_s_setGraph;
static PyObject *__pyx_n_s_setH;
static PyObject *__pyx_n_s_setcbondto;
static PyObject *__pyx_n_u_setitem;
static PyObject *__pyx_n_s_singleterminals;
static PyObject *__pyx_n_s_singleton;
static PyObject *__pyx_n_s_six;
static PyObject *__pyx_n_s_skeleton;
static PyObject *__pyx_n_s_smi;
static PyObject *__pyx_n_s_smiles;
static PyObject *__pyx_n_s_smilex;
static PyObject *__pyx_n_s_smilexer;
static PyObject *__pyx_n_u_smilextab;
static PyObject *__pyx_n_s_smiparserspec;
static PyObject *__pyx_kp_u_smiparsetab_pyl;
static PyObject *__pyx_n_s_smitokens;
static PyObject *__pyx_n_u_smitokens_2;
static PyObject *__pyx_n_s_sname;
static PyObject *__pyx_n_s_sort;
static PyObject *__pyx_n_s_sorted;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_special;
static PyObject *__pyx_n_s_special_2;
static PyObject *__pyx_n_s_splitIsoGroup;
static PyObject *__pyx_n_s_squaredistmax;
static PyObject *__pyx_n_s_sqyaredistsum;
static PyObject *__pyx_n_s_st;
static PyObject *__pyx_n_s_stabilizeSmiles;
static PyObject *__pyx_n_s_stableSmiles;
static PyObject *__pyx_n_s_startindex;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_u_str;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_symbol;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t1;
static PyObject *__pyx_n_s_t2;
static PyObject *__pyx_n_s_tallyDistanceIndexes;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_terminals;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_s_tg1;
static PyObject *__pyx_n_s_tg2;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tl;
static PyObject *__pyx_n_s_toSmiles;
static PyObject *__pyx_n_s_tok;
static PyObject *__pyx_n_s_tok2;
static PyObject *__pyx_n_s_tokenKeyValue;
static PyObject *__pyx_n_s_toklst;
static PyObject *__pyx_n_s_tokringdict;
static PyObject *__pyx_n_s_tokringlist;
static PyObject *__pyx_n_s_type0;
static PyObject *__pyx_n_s_type1;
static PyObject *__pyx_n_s_unichr;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_valence;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_verbose;
static PyObject *__pyx_n_s_weight;
static PyObject *__pyx_n_s_withIndList;
static PyObject *__pyx_n_s_withindex;
static PyObject *__pyx_n_s_withname;
static PyObject *__pyx_n_s_withoccurences;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_writer;
static PyObject *__pyx_n_u_writer;
static PyObject *__pyx_n_s_written;
static PyObject *__pyx_n_s_yacc;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_smiles, PyObject *__pyx_v_sequence, PyObject *__pyx_v_lexline, PyObject *__pyx_v_lexpos, PyObject *__pyx_v_modelname); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_2msg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_SmilesToCanonic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_kekulize, PyObject *__pyx_v_indexlist, PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_2stabilizeSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_indexlist, CYTHON_UNUSED PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_4addClassToSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_markatom, PyObject *__pyx_v_data, PyObject *__pyx_v_prefix, PyObject *__pyx_v_reduced, PyObject *__pyx_v_fullH, PyObject *__pyx_v_withindex); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_smiles, PyObject *__pyx_v_name, PyObject *__pyx_v_isoalgo, PyObject *__pyx_v_fullH); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_2setGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_4graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ordered, PyObject *__pyx_v_asBond, PyObject *__pyx_v_commonBonds); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_8closureCandidates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_10kekulize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_action); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_12remove(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14normalizeNumeros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16getBrokenBonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_18postprocess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isoalgo, PyObject *__pyx_v_fullH); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_20splitIsoGroup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_lst); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_22ReduceIsoGroup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_lst); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_24mass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_26printAll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_argv, PyObject *__pyx_v_kwd); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_28write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ff, PyObject *__pyx_v_argv, PyObject *__pyx_v_kwd); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_30getdiff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_32_analyseinitiale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_withoccurences); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_18__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_34analyse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_grade, PyObject *__pyx_v_iso, PyObject *__pyx_v_chiral, CYTHON_UNUSED PyObject *__pyx_v_charge, PyObject *__pyx_v_occurs, PyObject *__pyx_v_occurmols); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_36computedistances(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_includebroken, PyObject *__pyx_v_maxiter); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_38tallyDistanceIndexes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_outputindex); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_40getChargeList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_42getCentralAtom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cmax, PyObject *__pyx_v_centraux); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_44getskeleton(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_central, PyObject *__pyx_v_coupurecycles); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_46atomgen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_singleton); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_49clearModelBrokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_51clearbrokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_53recreatebrokenbonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_55bonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_58ringClosureMax(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_60getSmilesStart(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_62getEquivalents(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_64equivalentList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indexOnly); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_66getReducedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_20__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_68getSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_withIndList, PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax, PyObject *__pyx_v_special); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_6adj2dist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Mnadj, PyObject *__pyx_v_MDist, PyObject *__pyx_v_ind, PyObject *__pyx_v_ll); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_8isSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_10isInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_count = {0, &__pyx_n_s_count, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_index = {0, &__pyx_n_s_index, 0, 0, 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_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_8593;
static PyObject *__pyx_int_36863;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__10;
static PyObject *__pyx_slice__11;
static PyObject *__pyx_slice__12;
static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__23;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__25;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
/* Late includes */

/* "metaphor/chem_gm/core/metamolecule.py":71
 *     """Exception in SMILES parsing
 *     """
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):             # <<<<<<<<<<<<<<
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_smiles = 0;
  PyObject *__pyx_v_sequence = 0;
  PyObject *__pyx_v_lexline = 0;
  PyObject *__pyx_v_lexpos = 0;
  PyObject *__pyx_v_modelname = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_smiles,&__pyx_n_s_sequence,&__pyx_n_s_lexline,&__pyx_n_s_lexpos,&__pyx_n_s_modelname,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_kp_u_Smiles_parser_Error));
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u_));
    values[3] = ((PyObject *)((PyObject*)__pyx_kp_u_));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject*)__pyx_kp_u_));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (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_message);
          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_smiles);
          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_sequence);
          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_lexline);
          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_lexpos);
          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_modelname);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_smiles = values[2];
    __pyx_v_sequence = values[3];
    __pyx_v_lexline = values[4];
    __pyx_v_lexpos = values[5];
    __pyx_v_modelname = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.SmileParserError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_smiles, __pyx_v_sequence, __pyx_v_lexline, __pyx_v_lexpos, __pyx_v_modelname);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_smiles, PyObject *__pyx_v_sequence, PyObject *__pyx_v_lexline, PyObject *__pyx_v_lexpos, PyObject *__pyx_v_modelname) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":72
 *     """
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):
 *         super(SmileParserError, self).__init__(message)             # <<<<<<<<<<<<<<
 *         self.smiles = smiles
 *         self.sequence = sequence
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_SmileParserError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __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, 72, __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, 72, __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_v_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_message};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_message};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_message);
      __Pyx_GIVEREF(__pyx_v_message);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_message);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":73
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles             # <<<<<<<<<<<<<<
 *         self.sequence = sequence
 *         self.lexline = lexline
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_smiles, __pyx_v_smiles) < 0) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":74
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles
 *         self.sequence = sequence             # <<<<<<<<<<<<<<
 *         self.lexline = lexline
 *         self.lexpos = lexpos
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sequence, __pyx_v_sequence) < 0) __PYX_ERR(0, 74, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":75
 *         self.smiles = smiles
 *         self.sequence = sequence
 *         self.lexline = lexline             # <<<<<<<<<<<<<<
 *         self.lexpos = lexpos
 *         self.errortype = message
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lexline, __pyx_v_lexline) < 0) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":76
 *         self.sequence = sequence
 *         self.lexline = lexline
 *         self.lexpos = lexpos             # <<<<<<<<<<<<<<
 *         self.errortype = message
 *         if smiles:# and sequence:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lexpos, __pyx_v_lexpos) < 0) __PYX_ERR(0, 76, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":77
 *         self.lexline = lexline
 *         self.lexpos = lexpos
 *         self.errortype = message             # <<<<<<<<<<<<<<
 *         if smiles:# and sequence:
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_errortype, __pyx_v_message) < 0) __PYX_ERR(0, 77, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":78
 *         self.lexpos = lexpos
 *         self.errortype = message
 *         if smiles:# and sequence:             # <<<<<<<<<<<<<<
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 *             if lexline:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_smiles); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/metamolecule.py":79
 *         self.errortype = message
 *         if smiles:# and sequence:
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)             # <<<<<<<<<<<<<<
 *             if lexline:
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__2);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__2);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_smiles), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__3);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_sequence), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_t_4) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":80
 *         if smiles:# and sequence:
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 *             if lexline:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 *             if lexpos:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_lexline); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 80, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/metamolecule.py":81
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 *             if lexline:
 *                 self.message = "%s, line: %s"%(self.message, lexline)             # <<<<<<<<<<<<<<
 *             if lexpos:
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 */
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u_line);
      __pyx_t_6 += 8;
      __Pyx_GIVEREF(__pyx_kp_u_line);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_line);
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_lexline), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":80
 *         if smiles:# and sequence:
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 *             if lexline:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 *             if lexpos:
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":82
 *             if lexline:
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 *             if lexpos:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 *             if modelname:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_lexpos); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/metamolecule.py":83
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 *             if lexpos:
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)             # <<<<<<<<<<<<<<
 *             if modelname:
 *                 self.message = "%s, name: %s"%(self.message, modelname)
 */
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __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, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_pos);
      __pyx_t_6 += 7;
      __Pyx_GIVEREF(__pyx_kp_u_pos);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_pos);
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_lexpos), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":82
 *             if lexline:
 *                 self.message = "%s, line: %s"%(self.message, lexline)
 *             if lexpos:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 *             if modelname:
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":84
 *             if lexpos:
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 *             if modelname:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, name: %s"%(self.message, modelname)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_modelname); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/metamolecule.py":85
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 *             if modelname:
 *                 self.message = "%s, name: %s"%(self.message, modelname)             # <<<<<<<<<<<<<<
 * 
 *     @Property
 */
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_name);
      __pyx_t_6 += 8;
      __Pyx_GIVEREF(__pyx_kp_u_name);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_name);
      __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_modelname), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_t_4) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":84
 *             if lexpos:
 *                 self.message = "%s, pos: %s"%(self.message, lexpos)
 *             if modelname:             # <<<<<<<<<<<<<<
 *                 self.message = "%s, name: %s"%(self.message, modelname)
 * 
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":78
 *         self.lexpos = lexpos
 *         self.errortype = message
 *         if smiles:# and sequence:             # <<<<<<<<<<<<<<
 *             self.message = "%s: %s, %s"%(self.message, smiles, sequence)
 *             if lexline:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":71
 *     """Exception in SMILES parsing
 *     """
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):             # <<<<<<<<<<<<<<
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.SmileParserError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":88
 * 
 *     @Property
 *     def msg(self):             # <<<<<<<<<<<<<<
 *         if not self.smiles:
 *             return self.message
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_3msg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_3msg = {"msg", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_3msg, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_3msg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("msg (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_2msg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_2msg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_mark = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("msg", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":89
 *     @Property
 *     def msg(self):
 *         if not self.smiles:             # <<<<<<<<<<<<<<
 *             return self.message
 *         mark = "-"* int(self.lexpos)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_smiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 89, __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/metamolecule.py":90
 *     def msg(self):
 *         if not self.smiles:
 *             return self.message             # <<<<<<<<<<<<<<
 *         mark = "-"* int(self.lexpos)
 *         st = "%s line: %d\n\t"%(self.errortype, self.lexline)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":89
 *     @Property
 *     def msg(self):
 *         if not self.smiles:             # <<<<<<<<<<<<<<
 *             return self.message
 *         mark = "-"* int(self.lexpos)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":91
 *         if not self.smiles:
 *             return self.message
 *         mark = "-"* int(self.lexpos)             # <<<<<<<<<<<<<<
 *         st = "%s line: %d\n\t"%(self.errortype, self.lexline)
 *         #try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_kp_u__4, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_mark = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":92
 *             return self.message
 *         mark = "-"* int(self.lexpos)
 *         st = "%s line: %d\n\t"%(self.errortype, self.lexline)             # <<<<<<<<<<<<<<
 *         #try:
 *         st += "%s\n\t%s%s" %(self.smiles, mark, six.unichr(0x2191))#02c6
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errortype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_line_2);
  __pyx_t_5 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_line_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_line_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexline); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__5);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_st = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":94
 *         st = "%s line: %d\n\t"%(self.errortype, self.lexline)
 *         #try:
 *         st += "%s\n\t%s%s" %(self.smiles, mark, six.unichr(0x2191))#02c6             # <<<<<<<<<<<<<<
 * #         except:
 * #             st += "%s\n\t%s%s" %(self.smiles, mark, unichr(0x2191))#02c6
 */
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_smiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__5);
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_mark), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_v_st, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_st, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":97
 * #         except:
 * #             st += "%s\n\t%s%s" %(self.smiles, mark, unichr(0x2191))#02c6
 *         return st + "\n"             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_v_st, __pyx_kp_u__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":88
 * 
 *     @Property
 *     def msg(self):             # <<<<<<<<<<<<<<
 *         if not self.smiles:
 *             return self.message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.SmileParserError.msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mark);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":100
 * 
 * #-------------------------------------------------------------------------------
 * def SmilesToCanonic(source, isomeric=False, kekulize=0, indexlist=False, withname=False, fullH=False, itermax=0):             # <<<<<<<<<<<<<<
 *     """Convert a SMILES to a canonic SMILES
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_1SmilesToCanonic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_SmilesToCanonic[] = "Convert a SMILES to a canonic SMILES\n    ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_1SmilesToCanonic = {"SmilesToCanonic", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_1SmilesToCanonic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_SmilesToCanonic};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_1SmilesToCanonic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_isomeric = 0;
  PyObject *__pyx_v_kekulize = 0;
  PyObject *__pyx_v_indexlist = 0;
  PyObject *__pyx_v_withname = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_v_itermax = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SmilesToCanonic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_isomeric,&__pyx_n_s_kekulize,&__pyx_n_s_indexlist,&__pyx_n_s_withname,&__pyx_n_s_fullH,&__pyx_n_s_itermax,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)Py_False));
    values[6] = ((PyObject *)((PyObject *)__pyx_int_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  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_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isomeric);
          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_kekulize);
          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_indexlist);
          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_withname);
          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_fullH);
          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_itermax);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SmilesToCanonic") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_isomeric = values[1];
    __pyx_v_kekulize = values[2];
    __pyx_v_indexlist = values[3];
    __pyx_v_withname = values[4];
    __pyx_v_fullH = values[5];
    __pyx_v_itermax = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("SmilesToCanonic", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.SmilesToCanonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_SmilesToCanonic(__pyx_self, __pyx_v_source, __pyx_v_isomeric, __pyx_v_kekulize, __pyx_v_indexlist, __pyx_v_withname, __pyx_v_fullH, __pyx_v_itermax);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_SmilesToCanonic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_kekulize, PyObject *__pyx_v_indexlist, PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_mol = NULL;
  PyObject *__pyx_7genexpr__pyx_v_sname = NULL;
  PyObject *__pyx_7genexpr__pyx_v_smi = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  __Pyx_RefNannySetupContext("SmilesToCanonic", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":103
 *     """Convert a SMILES to a canonic SMILES
 *     """
 *     res = None             # <<<<<<<<<<<<<<
 *     if isinstance(source, str):
 *         mol = MetaMolecule(source, fullH=fullH)
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_res = Py_None;

  /* "metaphor/chem_gm/core/metamolecule.py":104
 *     """
 *     res = None
 *     if isinstance(source, str):             # <<<<<<<<<<<<<<
 *         mol = MetaMolecule(source, fullH=fullH)
 *         if kekulize:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_source); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":105
 *     res = None
 *     if isinstance(source, str):
 *         mol = MetaMolecule(source, fullH=fullH)             # <<<<<<<<<<<<<<
 *         if kekulize:
 *             mol.kekulize((kekulize-1) % 2)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_mol = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":106
 *     if isinstance(source, str):
 *         mol = MetaMolecule(source, fullH=fullH)
 *         if kekulize:             # <<<<<<<<<<<<<<
 *             mol.kekulize((kekulize-1) % 2)
 *         if verbose > 1:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kekulize); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 106, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":107
 *         mol = MetaMolecule(source, fullH=fullH)
 *         if kekulize:
 *             mol.kekulize((kekulize-1) % 2)             # <<<<<<<<<<<<<<
 *         if verbose > 1:
 *             mol.printAll()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_mol, __pyx_n_s_kekulize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_kekulize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_4, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":106
 *     if isinstance(source, str):
 *         mol = MetaMolecule(source, fullH=fullH)
 *         if kekulize:             # <<<<<<<<<<<<<<
 *             mol.kekulize((kekulize-1) % 2)
 *         if verbose > 1:
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":108
 *         if kekulize:
 *             mol.kekulize((kekulize-1) % 2)
 *         if verbose > 1:             # <<<<<<<<<<<<<<
 *             mol.printAll()
 *         res = mol.getSmiles(isomeric, indexlist, itermax=itermax, fullH=fullH)
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_verbose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":109
 *             mol.kekulize((kekulize-1) % 2)
 *         if verbose > 1:
 *             mol.printAll()             # <<<<<<<<<<<<<<
 *         res = mol.getSmiles(isomeric, indexlist, itermax=itermax, fullH=fullH)
 * #     elif isinstance(source, tuple) and isinstance(source[1], basestring):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mol, __pyx_n_s_printAll); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":108
 *         if kekulize:
 *             mol.kekulize((kekulize-1) % 2)
 *         if verbose > 1:             # <<<<<<<<<<<<<<
 *             mol.printAll()
 *         res = mol.getSmiles(isomeric, indexlist, itermax=itermax, fullH=fullH)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":110
 *         if verbose > 1:
 *             mol.printAll()
 *         res = mol.getSmiles(isomeric, indexlist, itermax=itermax, fullH=fullH)             # <<<<<<<<<<<<<<
 * #     elif isinstance(source, tuple) and isinstance(source[1], basestring):
 * #         sname, smi = source
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_mol, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_isomeric);
    __Pyx_GIVEREF(__pyx_v_isomeric);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_isomeric);
    __Pyx_INCREF(__pyx_v_indexlist);
    __Pyx_GIVEREF(__pyx_v_indexlist);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_indexlist);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_itermax, __pyx_v_itermax) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":104
 *     """
 *     res = None
 *     if isinstance(source, str):             # <<<<<<<<<<<<<<
 *         mol = MetaMolecule(source, fullH=fullH)
 *         if kekulize:
 */
    goto __pyx_L3;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":115
 * #         mol = MetaMolecule(smi)
 * #         res = sname, mol.getSmiles(isomeric, indexlist)
 *     elif isinstance(source, list):             # <<<<<<<<<<<<<<
 *         if not len(source):
 *             res = []
 */
  __pyx_t_2 = PyList_Check(__pyx_v_source); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/chem_gm/core/metamolecule.py":116
 * #         res = sname, mol.getSmiles(isomeric, indexlist)
 *     elif isinstance(source, list):
 *         if not len(source):             # <<<<<<<<<<<<<<
 *             res = []
 *         elif isinstance(source[0], tuple):
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_source); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
    __pyx_t_1 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_1) {

      /* "metaphor/chem_gm/core/metamolecule.py":117
 *     elif isinstance(source, list):
 *         if not len(source):
 *             res = []             # <<<<<<<<<<<<<<
 *         elif isinstance(source[0], tuple):
 *             res = [MetaMolecule(smi, sname, fullH=fullH).getSmiles(isomeric, indexlist, withname, itermax=itermax) for sname, smi in source]
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":116
 * #         res = sname, mol.getSmiles(isomeric, indexlist)
 *     elif isinstance(source, list):
 *         if not len(source):             # <<<<<<<<<<<<<<
 *             res = []
 *         elif isinstance(source[0], tuple):
 */
      goto __pyx_L6;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":118
 *         if not len(source):
 *             res = []
 *         elif isinstance(source[0], tuple):             # <<<<<<<<<<<<<<
 *             res = [MetaMolecule(smi, sname, fullH=fullH).getSmiles(isomeric, indexlist, withname, itermax=itermax) for sname, smi in source]
 *         else:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_Check(__pyx_t_3); 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":119
 *             res = []
 *         elif isinstance(source[0], tuple):
 *             res = [MetaMolecule(smi, sname, fullH=fullH).getSmiles(isomeric, indexlist, withname, itermax=itermax) for sname, smi in source]             # <<<<<<<<<<<<<<
 *         else:
 *             res = [MetaMolecule(val, fullH=fullH).getSmiles(isomeric, indexlist, itermax=itermax) for val in source]
 */
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_v_source)) || PyTuple_CheckExact(__pyx_v_source)) {
          __pyx_t_7 = __pyx_v_source; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L9_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_8 >= 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_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 119, __pyx_L9_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 119, __pyx_L9_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_9(__pyx_t_7);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 119, __pyx_L9_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
            PyObject* sequence = __pyx_t_6;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 119, __pyx_L9_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            #else
            __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
            index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_5);
            index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_4);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 119, __pyx_L9_error)
            __pyx_t_11 = NULL;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L13_unpacking_done;
            __pyx_L12_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_11 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 119, __pyx_L9_error)
            __pyx_L13_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_sname, __pyx_t_5);
          __pyx_t_5 = 0;
          __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_smi, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_7genexpr__pyx_v_smi);
          __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_smi);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_7genexpr__pyx_v_smi);
          __Pyx_INCREF(__pyx_7genexpr__pyx_v_sname);
          __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_sname);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_7genexpr__pyx_v_sname);
          __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 119, __pyx_L9_error)
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_isomeric);
          __Pyx_GIVEREF(__pyx_v_isomeric);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_isomeric);
          __Pyx_INCREF(__pyx_v_indexlist);
          __Pyx_GIVEREF(__pyx_v_indexlist);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_indexlist);
          __Pyx_INCREF(__pyx_v_withname);
          __Pyx_GIVEREF(__pyx_v_withname);
          PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_withname);
          __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_itermax, __pyx_v_itermax) < 0) __PYX_ERR(0, 119, __pyx_L9_error)
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 119, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_smi); __pyx_7genexpr__pyx_v_smi = 0;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_sname); __pyx_7genexpr__pyx_v_sname = 0;
        goto __pyx_L14_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_smi); __pyx_7genexpr__pyx_v_smi = 0;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_sname); __pyx_7genexpr__pyx_v_sname = 0;
        goto __pyx_L1_error;
        __pyx_L14_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":118
 *         if not len(source):
 *             res = []
 *         elif isinstance(source[0], tuple):             # <<<<<<<<<<<<<<
 *             res = [MetaMolecule(smi, sname, fullH=fullH).getSmiles(isomeric, indexlist, withname, itermax=itermax) for sname, smi in source]
 *         else:
 */
      goto __pyx_L6;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":121
 *             res = [MetaMolecule(smi, sname, fullH=fullH).getSmiles(isomeric, indexlist, withname, itermax=itermax) for sname, smi in source]
 *         else:
 *             res = [MetaMolecule(val, fullH=fullH).getSmiles(isomeric, indexlist, itermax=itermax) for val in source]             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_v_source)) || PyTuple_CheckExact(__pyx_v_source)) {
          __pyx_t_7 = __pyx_v_source; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L17_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_8 >= 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_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L17_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L17_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_9(__pyx_t_7);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 121, __pyx_L17_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_val, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_8genexpr1__pyx_v_val);
          __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_8genexpr1__pyx_v_val);
          __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 121, __pyx_L17_error)
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_isomeric);
          __Pyx_GIVEREF(__pyx_v_isomeric);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_isomeric);
          __Pyx_INCREF(__pyx_v_indexlist);
          __Pyx_GIVEREF(__pyx_v_indexlist);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_indexlist);
          __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_itermax, __pyx_v_itermax) < 0) __PYX_ERR(0, 121, __pyx_L17_error)
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 121, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val); __pyx_8genexpr1__pyx_v_val = 0;
        goto __pyx_L20_exit_scope;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val); __pyx_8genexpr1__pyx_v_val = 0;
        goto __pyx_L1_error;
        __pyx_L20_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L6:;

    /* "metaphor/chem_gm/core/metamolecule.py":115
 * #         mol = MetaMolecule(smi)
 * #         res = sname, mol.getSmiles(isomeric, indexlist)
 *     elif isinstance(source, list):             # <<<<<<<<<<<<<<
 *         if not len(source):
 *             res = []
 */
  }
  __pyx_L3:;

  /* "metaphor/chem_gm/core/metamolecule.py":122
 *         else:
 *             res = [MetaMolecule(val, fullH=fullH).getSmiles(isomeric, indexlist, itermax=itermax) for val in source]
 *     return res             # <<<<<<<<<<<<<<
 * 
 * def stabilizeSmiles(source, isomeric=False, indexlist=False, withname=False, fullH=False, itermax=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":100
 * 
 * #-------------------------------------------------------------------------------
 * def SmilesToCanonic(source, isomeric=False, kekulize=0, indexlist=False, withname=False, fullH=False, itermax=0):             # <<<<<<<<<<<<<<
 *     """Convert a SMILES to a canonic SMILES
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.SmilesToCanonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_mol);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_sname);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_smi);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":124
 *     return res
 * 
 * def stabilizeSmiles(source, isomeric=False, indexlist=False, withname=False, fullH=False, itermax=10):             # <<<<<<<<<<<<<<
 *     """Gives a stable SMILES
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_3stabilizeSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_2stabilizeSmiles[] = "Gives a stable SMILES\n    ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_3stabilizeSmiles = {"stabilizeSmiles", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_3stabilizeSmiles, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_2stabilizeSmiles};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_3stabilizeSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_isomeric = 0;
  PyObject *__pyx_v_indexlist = 0;
  CYTHON_UNUSED PyObject *__pyx_v_withname = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_v_itermax = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stabilizeSmiles (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_isomeric,&__pyx_n_s_indexlist,&__pyx_n_s_withname,&__pyx_n_s_fullH,&__pyx_n_s_itermax,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_10));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isomeric);
          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_indexlist);
          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_withname);
          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_fullH);
          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_itermax);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stabilizeSmiles") < 0)) __PYX_ERR(0, 124, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_isomeric = values[1];
    __pyx_v_indexlist = values[2];
    __pyx_v_withname = values[3];
    __pyx_v_fullH = values[4];
    __pyx_v_itermax = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stabilizeSmiles", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.stabilizeSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_2stabilizeSmiles(__pyx_self, __pyx_v_source, __pyx_v_isomeric, __pyx_v_indexlist, __pyx_v_withname, __pyx_v_fullH, __pyx_v_itermax);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_2stabilizeSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_indexlist, CYTHON_UNUSED PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("stabilizeSmiles", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":127
 *     """Gives a stable SMILES
 *     """
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)             # <<<<<<<<<<<<<<
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_isomeric, __pyx_v_isomeric) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_withIndList, __pyx_v_indexlist) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_itermax, __pyx_v_itermax) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":124
 *     return res
 * 
 * def stabilizeSmiles(source, isomeric=False, indexlist=False, withname=False, fullH=False, itermax=10):             # <<<<<<<<<<<<<<
 *     """Gives a stable SMILES
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.stabilizeSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_markatom);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_markatom);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_markatom);
  __Pyx_INCREF(((PyObject *)__pyx_int_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_1));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_1));
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_0));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __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.metamolecule.__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_12metamolecule_5addClassToSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_5addClassToSmiles = {"addClassToSmiles", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_5addClassToSmiles, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_5addClassToSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_markatom = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_prefix = 0;
  PyObject *__pyx_v_reduced = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_v_withindex = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addClassToSmiles (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_markatom,&__pyx_n_s_data,&__pyx_n_s_prefix,&__pyx_n_s_reduced,&__pyx_n_s_fullH,&__pyx_n_s_withindex,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_markatom;
    values[2] = ((PyObject *)((PyObject *)__pyx_int_1));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)Py_False));
    values[6] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_markatom);
          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_data);
          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_prefix);
          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_reduced);
          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_fullH);
          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_withindex);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addClassToSmiles") < 0)) __PYX_ERR(0, 129, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_markatom = values[1];
    __pyx_v_data = values[2];
    __pyx_v_prefix = values[3];
    __pyx_v_reduced = values[4];
    __pyx_v_fullH = values[5];
    __pyx_v_withindex = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addClassToSmiles", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 129, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.addClassToSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_4addClassToSmiles(__pyx_self, __pyx_v_source, __pyx_v_markatom, __pyx_v_data, __pyx_v_prefix, __pyx_v_reduced, __pyx_v_fullH, __pyx_v_withindex);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":140
 *     else:
 *         lst = mol
 *     toklst = (tok for tok in lst if tok.symbol in markatom)             # <<<<<<<<<<<<<<
 *     res = []
 *     for tok in toklst:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 140, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_addClassToSmiles_locals_genexpr, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.addClassToSmiles.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 140, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lst)) { __Pyx_RaiseClosureNameError("lst"); __PYX_ERR(0, 140, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lst)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lst)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 140, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tok);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tok, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_markatom)) { __Pyx_RaiseClosureNameError("markatom"); __PYX_ERR(0, 140, __pyx_L1_error) }
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_markatom, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tok);
      __pyx_r = __pyx_cur_scope->__pyx_v_tok;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 140, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_4addClassToSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_markatom, PyObject *__pyx_v_data, PyObject *__pyx_v_prefix, PyObject *__pyx_v_reduced, PyObject *__pyx_v_fullH, PyObject *__pyx_v_withindex) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *__pyx_cur_scope;
  PyObject *__pyx_v_stableSmiles = NULL;
  PyObject *__pyx_v_mol = NULL;
  PyObject *__pyx_v_toklst = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_mem = NULL;
  PyObject *__pyx_v_massmem = NULL;
  PyObject *__pyx_v_smi = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("addClassToSmiles", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 129, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_markatom = __pyx_v_markatom;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_markatom);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_markatom);
  __Pyx_INCREF(__pyx_v_fullH);

  /* "metaphor/chem_gm/core/metamolecule.py":130
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):
 *     if isinstance(markatom, str):             # <<<<<<<<<<<<<<
 *         markatom = [markatom]
 *     if "H" in markatom:
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_markatom;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/metamolecule.py":131
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):
 *     if isinstance(markatom, str):
 *         markatom = [markatom]             # <<<<<<<<<<<<<<
 *     if "H" in markatom:
 *         fullH = True
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_markatom);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_markatom);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_markatom);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_markatom);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_markatom, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":130
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):
 *     if isinstance(markatom, str):             # <<<<<<<<<<<<<<
 *         markatom = [markatom]
 *     if "H" in markatom:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":132
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 *     if "H" in markatom:             # <<<<<<<<<<<<<<
 *         fullH = True
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 */
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_H, __pyx_cur_scope->__pyx_v_markatom, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":133
 *         markatom = [markatom]
 *     if "H" in markatom:
 *         fullH = True             # <<<<<<<<<<<<<<
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)
 */
    __Pyx_INCREF(Py_True);
    __Pyx_DECREF_SET(__pyx_v_fullH, Py_True);

    /* "metaphor/chem_gm/core/metamolecule.py":132
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 *     if "H" in markatom:             # <<<<<<<<<<<<<<
 *         fullH = True
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":134
 *     if "H" in markatom:
 *         fullH = True
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)             # <<<<<<<<<<<<<<
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)
 *     if reduced:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_stabilizeSmiles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_source, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_source, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_source);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __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_v_stableSmiles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":135
 *         fullH = True
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)             # <<<<<<<<<<<<<<
 *     if reduced:
 *         lst = mol.getReducedList()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_stableSmiles);
  __Pyx_GIVEREF(__pyx_v_stableSmiles);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stableSmiles);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_mol = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":136
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)
 *     if reduced:             # <<<<<<<<<<<<<<
 *         lst = mol.getReducedList()
 *     else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reduced); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 136, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":137
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)
 *     if reduced:
 *         lst = mol.getReducedList()             # <<<<<<<<<<<<<<
 *     else:
 *         lst = mol
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_mol, __pyx_n_s_getReducedList); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_lst = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":136
 *     stableSmiles = stabilizeSmiles(source, False)  #, fullH=fullH)
 *     mol = MetaMolecule(stableSmiles, fullH=fullH)
 *     if reduced:             # <<<<<<<<<<<<<<
 *         lst = mol.getReducedList()
 *     else:
 */
    goto __pyx_L5;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":139
 *         lst = mol.getReducedList()
 *     else:
 *         lst = mol             # <<<<<<<<<<<<<<
 *     toklst = (tok for tok in lst if tok.symbol in markatom)
 *     res = []
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_mol);
    __Pyx_GIVEREF(__pyx_v_mol);
    __pyx_cur_scope->__pyx_v_lst = __pyx_v_mol;
  }
  __pyx_L5:;

  /* "metaphor/chem_gm/core/metamolecule.py":140
 *     else:
 *         lst = mol
 *     toklst = (tok for tok in lst if tok.symbol in markatom)             # <<<<<<<<<<<<<<
 *     res = []
 *     for tok in toklst:
 */
  __pyx_t_5 = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16addClassToSmiles_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_toklst = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":141
 *         lst = mol
 *     toklst = (tok for tok in lst if tok.symbol in markatom)
 *     res = []             # <<<<<<<<<<<<<<
 *     for tok in toklst:
 *         mem = tok.applidata
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_res = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":142
 *     toklst = (tok for tok in lst if tok.symbol in markatom)
 *     res = []
 *     for tok in toklst:             # <<<<<<<<<<<<<<
 *         mem = tok.applidata
 *         tok.applidata = data
 */
  if (likely(PyList_CheckExact(__pyx_v_toklst)) || PyTuple_CheckExact(__pyx_v_toklst)) {
    __pyx_t_5 = __pyx_v_toklst; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_toklst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_9(__pyx_t_5);
      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, 142, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":143
 *     res = []
 *     for tok in toklst:
 *         mem = tok.applidata             # <<<<<<<<<<<<<<
 *         tok.applidata = data
 *         if prefix:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_applidata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_mem, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":144
 *     for tok in toklst:
 *         mem = tok.applidata
 *         tok.applidata = data             # <<<<<<<<<<<<<<
 *         if prefix:
 *             massmem = tok._atomicMass
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_applidata, __pyx_v_data) < 0) __PYX_ERR(0, 144, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":145
 *         mem = tok.applidata
 *         tok.applidata = data
 *         if prefix:             # <<<<<<<<<<<<<<
 *             massmem = tok._atomicMass
 *             tok._atomicMass = prefix
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":146
 *         tok.applidata = data
 *         if prefix:
 *             massmem = tok._atomicMass             # <<<<<<<<<<<<<<
 *             tok._atomicMass = prefix
 *         smi = mol.getSmiles(True, fullH=fullH)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_atomicMass); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_massmem, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":147
 *         if prefix:
 *             massmem = tok._atomicMass
 *             tok._atomicMass = prefix             # <<<<<<<<<<<<<<
 *         smi = mol.getSmiles(True, fullH=fullH)
 *         if withindex:
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_atomicMass, __pyx_v_prefix) < 0) __PYX_ERR(0, 147, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":145
 *         mem = tok.applidata
 *         tok.applidata = data
 *         if prefix:             # <<<<<<<<<<<<<<
 *             massmem = tok._atomicMass
 *             tok._atomicMass = prefix
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":148
 *             massmem = tok._atomicMass
 *             tok._atomicMass = prefix
 *         smi = mol.getSmiles(True, fullH=fullH)             # <<<<<<<<<<<<<<
 *         if withindex:
 *             res.append((tok.numero, smi))
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_mol, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__8, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __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_XDECREF_SET(__pyx_v_smi, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":149
 *             tok._atomicMass = prefix
 *         smi = mol.getSmiles(True, fullH=fullH)
 *         if withindex:             # <<<<<<<<<<<<<<
 *             res.append((tok.numero, smi))
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_withindex); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":150
 *         smi = mol.getSmiles(True, fullH=fullH)
 *         if withindex:
 *             res.append((tok.numero, smi))             # <<<<<<<<<<<<<<
 *         else:
 *             res.append(smi)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_INCREF(__pyx_v_smi);
      __Pyx_GIVEREF(__pyx_v_smi);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_smi);
      __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":149
 *             tok._atomicMass = prefix
 *         smi = mol.getSmiles(True, fullH=fullH)
 *         if withindex:             # <<<<<<<<<<<<<<
 *             res.append((tok.numero, smi))
 *         else:
 */
      goto __pyx_L9;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":152
 *             res.append((tok.numero, smi))
 *         else:
 *             res.append(smi)             # <<<<<<<<<<<<<<
 *         tok.applidata = mem
 *         if prefix:
 */
    /*else*/ {
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_smi); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 152, __pyx_L1_error)
    }
    __pyx_L9:;

    /* "metaphor/chem_gm/core/metamolecule.py":153
 *         else:
 *             res.append(smi)
 *         tok.applidata = mem             # <<<<<<<<<<<<<<
 *         if prefix:
 *             tok._atomicMass = massmem
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_applidata, __pyx_v_mem) < 0) __PYX_ERR(0, 153, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":154
 *             res.append(smi)
 *         tok.applidata = mem
 *         if prefix:             # <<<<<<<<<<<<<<
 *             tok._atomicMass = massmem
 *     return res
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":155
 *         tok.applidata = mem
 *         if prefix:
 *             tok._atomicMass = massmem             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
      if (unlikely(!__pyx_v_massmem)) { __Pyx_RaiseUnboundLocalError("massmem"); __PYX_ERR(0, 155, __pyx_L1_error) }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_atomicMass, __pyx_v_massmem) < 0) __PYX_ERR(0, 155, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":154
 *             res.append(smi)
 *         tok.applidata = mem
 *         if prefix:             # <<<<<<<<<<<<<<
 *             tok._atomicMass = massmem
 *     return res
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":142
 *     toklst = (tok for tok in lst if tok.symbol in markatom)
 *     res = []
 *     for tok in toklst:             # <<<<<<<<<<<<<<
 *         mem = tok.applidata
 *         tok.applidata = data
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":156
 *         if prefix:
 *             tok._atomicMass = massmem
 *     return res             # <<<<<<<<<<<<<<
 * 
 * @delegate(["__smitokens", '__delitem__', "__getitem__", "__setitem__", "__iter__",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */

  /* 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_7);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.addClassToSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stableSmiles);
  __Pyx_XDECREF(__pyx_v_mol);
  __Pyx_XDECREF(__pyx_v_toklst);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_mem);
  __Pyx_XDECREF(__pyx_v_massmem);
  __Pyx_XDECREF(__pyx_v_smi);
  __Pyx_XDECREF(__pyx_v_fullH);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":180
 * #     - insert
 * 
 *     def __init__(self, smiles, name="", isoalgo=isoalgodefault, fullH=setH):             # <<<<<<<<<<<<<<
 *         '''MetaMolecule constructor
 *         '''
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_14__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, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_kp_u_));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_u_));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_kp_u_));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_isoalgo);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_isoalgo);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_isoalgo);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_fullH);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_fullH);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_fullH);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __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.metamolecule.__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_12metamolecule_12MetaMolecule_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule___init__[] = "MetaMolecule constructor\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule___init__};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_smiles = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_isoalgo = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_smiles,&__pyx_n_s_name_2,&__pyx_n_s_isoalgo,&__pyx_n_s_fullH,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*)__pyx_kp_u_));
    values[3] = __pyx_dynamic_args->__pyx_arg_isoalgo;
    values[4] = __pyx_dynamic_args->__pyx_arg_fullH;
    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_smiles)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isoalgo);
          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_fullH);
          if (value) { values[4] = 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, 180, __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_smiles = values[1];
    __pyx_v_name = values[2];
    __pyx_v_isoalgo = values[3];
    __pyx_v_fullH = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule___init__(__pyx_self, __pyx_v_self, __pyx_v_smiles, __pyx_v_name, __pyx_v_isoalgo, __pyx_v_fullH);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_smiles, PyObject *__pyx_v_name, PyObject *__pyx_v_isoalgo, PyObject *__pyx_v_fullH) {
  PyObject *__pyx_v_outputdir = NULL;
  PyObject *__pyx_v_picklefile = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":183
 *         '''MetaMolecule constructor
 *         '''
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.__smitokens = []
 *         self.smiles = raw(smiles).strip()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 183, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":184
 *         '''
 *         self.name = name
 *         self.__smitokens = []             # <<<<<<<<<<<<<<
 *         self.smiles = raw(smiles).strip()
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens, __pyx_t_1) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":185
 *         self.name = name
 *         self.__smitokens = []
 *         self.smiles = raw(smiles).strip()             # <<<<<<<<<<<<<<
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)
 *         if not os.path.exists(outputdir):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_smiles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_smiles};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_smiles};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_smiles);
      __Pyx_GIVEREF(__pyx_v_smiles);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_smiles);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __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, 185, __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, 185, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_smiles, __pyx_t_1) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":186
 *         self.__smitokens = []
 *         self.smiles = raw(smiles).strip()
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)             # <<<<<<<<<<<<<<
 *         if not os.path.exists(outputdir):
 *             os.mkdir(outputdir)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_appdatadir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_APPNAME, __pyx_n_u_graphmachine) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_docreate, Py_True) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __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_v_outputdir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":187
 *         self.smiles = raw(smiles).strip()
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)
 *         if not os.path.exists(outputdir):             # <<<<<<<<<<<<<<
 *             os.mkdir(outputdir)
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __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_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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_v_outputdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_outputdir};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_outputdir};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_outputdir);
      __Pyx_GIVEREF(__pyx_v_outputdir);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_outputdir);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (__pyx_t_7) {

    /* "metaphor/chem_gm/core/metamolecule.py":188
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)
 *         if not os.path.exists(outputdir):
 *             os.mkdir(outputdir)             # <<<<<<<<<<<<<<
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)
 *         self.lexer.tokringlist = []
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_outputdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_outputdir};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __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_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_outputdir};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_outputdir);
        __Pyx_GIVEREF(__pyx_v_outputdir);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_outputdir);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":187
 *         self.smiles = raw(smiles).strip()
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)
 *         if not os.path.exists(outputdir):             # <<<<<<<<<<<<<<
 *             os.mkdir(outputdir)
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":189
 *         if not os.path.exists(outputdir):
 *             os.mkdir(outputdir)
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)             # <<<<<<<<<<<<<<
 *         self.lexer.tokringlist = []
 *         self.lexer.tokringdict = {}
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_smilex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_module, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_outputdir, __pyx_v_outputdir) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lextab, __pyx_n_u_smilextab) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_optimize, __pyx_int_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lexer, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":190
 *             os.mkdir(outputdir)
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)
 *         self.lexer.tokringlist = []             # <<<<<<<<<<<<<<
 *         self.lexer.tokringdict = {}
 *         picklefile = os.path.join(outputdir, "smiparsetab.pyl")
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_tokringlist, __pyx_t_1) < 0) __PYX_ERR(0, 190, __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/metamolecule.py":191
 *         self.lexer = lex.lex(module=smilex, outputdir=outputdir, lextab="smilextab", optimize=1)
 *         self.lexer.tokringlist = []
 *         self.lexer.tokringdict = {}             # <<<<<<<<<<<<<<
 *         picklefile = os.path.join(outputdir, "smiparsetab.pyl")
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_tokringdict, __pyx_t_2) < 0) __PYX_ERR(0, 191, __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/metamolecule.py":192
 *         self.lexer.tokringlist = []
 *         self.lexer.tokringdict = {}
 *         picklefile = os.path.join(outputdir, "smiparsetab.pyl")             # <<<<<<<<<<<<<<
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 *         self.lexer.MetaMolecule = self.__smitokens
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_outputdir, __pyx_kp_u_smiparsetab_pyl};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_outputdir, __pyx_kp_u_smiparsetab_pyl};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_outputdir);
    __Pyx_GIVEREF(__pyx_v_outputdir);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_outputdir);
    __Pyx_INCREF(__pyx_kp_u_smiparsetab_pyl);
    __Pyx_GIVEREF(__pyx_kp_u_smiparsetab_pyl);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_kp_u_smiparsetab_pyl);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_picklefile = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":193
 *         self.lexer.tokringdict = {}
 *         picklefile = os.path.join(outputdir, "smiparsetab.pyl")
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)             # <<<<<<<<<<<<<<
 *         self.lexer.MetaMolecule = self.__smitokens
 *         try:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_yacc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_yacc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiparserspec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_module, __pyx_t_3) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_debug, __pyx_int_0) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_picklefile, __pyx_v_picklefile) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_outputdir, __pyx_v_outputdir) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parser, __pyx_t_3) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":194
 *         picklefile = os.path.join(outputdir, "smiparsetab.pyl")
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 *         self.lexer.MetaMolecule = self.__smitokens             # <<<<<<<<<<<<<<
 *         try:
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_MetaMolecule, __pyx_t_3) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":195
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 *         self.lexer.MetaMolecule = self.__smitokens
 *         try:             # <<<<<<<<<<<<<<
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "metaphor/chem_gm/core/metamolecule.py":196
 *         self.lexer.MetaMolecule = self.__smitokens
 *         try:
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)             # <<<<<<<<<<<<<<
 *         except KeyError as err:
 *             print(err)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_smiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L4_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_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lexer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lexer, __pyx_t_5) < 0) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __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;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_par, __pyx_t_5) < 0) __PYX_ERR(0, 196, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":195
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 *         self.lexer.MetaMolecule = self.__smitokens
 *         try:             # <<<<<<<<<<<<<<
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":197
 *         try:
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:             # <<<<<<<<<<<<<<
 *             print(err)
 *             #raise err
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_err = __pyx_t_1;
      /*try:*/ {

        /* "metaphor/chem_gm/core/metamolecule.py":198
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:
 *             print(err)             # <<<<<<<<<<<<<<
 *             #raise err
 *         self.isoalgo = isoalgo
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":197
 *         try:
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:             # <<<<<<<<<<<<<<
 *             print(err)
 *             #raise err
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_err);
          __pyx_v_err = NULL;
          goto __pyx_L16;
        }
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err);
            __pyx_v_err = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L6_except_error;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "metaphor/chem_gm/core/metamolecule.py":195
 *         self.parser = yacc.yacc(module=smiparserspec, debug=0, picklefile=picklefile, outputdir=outputdir)
 *         self.lexer.MetaMolecule = self.__smitokens
 *         try:             # <<<<<<<<<<<<<<
 *             self.par = self.parser.parse(self.smiles, lexer=self.lexer)
 *         except KeyError as err:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L9_try_end:;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":200
 *             print(err)
 *             #raise err
 *         self.isoalgo = isoalgo             # <<<<<<<<<<<<<<
 *         self.postprocess(isoalgo, fullH)
 *         self._ringsmiles = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_isoalgo, __pyx_v_isoalgo) < 0) __PYX_ERR(0, 200, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":201
 *             #raise err
 *         self.isoalgo = isoalgo
 *         self.postprocess(isoalgo, fullH)             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         self._ringmodel = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_12 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_isoalgo, __pyx_v_fullH};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_isoalgo, __pyx_v_fullH};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_isoalgo);
    __Pyx_GIVEREF(__pyx_v_isoalgo);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_12, __pyx_v_isoalgo);
    __Pyx_INCREF(__pyx_v_fullH);
    __Pyx_GIVEREF(__pyx_v_fullH);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_12, __pyx_v_fullH);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":202
 *         self.isoalgo = isoalgo
 *         self.postprocess(isoalgo, fullH)
 *         self._ringsmiles = 0             # <<<<<<<<<<<<<<
 *         self._ringmodel = 0
 *         self._graph = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringsmiles, __pyx_int_0) < 0) __PYX_ERR(0, 202, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":203
 *         self.postprocess(isoalgo, fullH)
 *         self._ringsmiles = 0
 *         self._ringmodel = 0             # <<<<<<<<<<<<<<
 *         self._graph = None
 *         self.invalid = True
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel, __pyx_int_0) < 0) __PYX_ERR(0, 203, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":204
 *         self._ringsmiles = 0
 *         self._ringmodel = 0
 *         self._graph = None             # <<<<<<<<<<<<<<
 *         self.invalid = True
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graph, Py_None) < 0) __PYX_ERR(0, 204, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":205
 *         self._ringmodel = 0
 *         self._graph = None
 *         self.invalid = True             # <<<<<<<<<<<<<<
 * 
 *     def setGraph(self): #MetaMolecule
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_invalid, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":180
 * #     - insert
 * 
 *     def __init__(self, smiles, name="", isoalgo=isoalgodefault, fullH=setH):             # <<<<<<<<<<<<<<
 *         '''MetaMolecule constructor
 *         '''
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_outputdir);
  __Pyx_XDECREF(__pyx_v_picklefile);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":207
 *         self.invalid = True
 * 
 *     def setGraph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         self._graph = nx.Graph(name=self.name)
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_3setGraph(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_3setGraph = {"setGraph", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_3setGraph, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_3setGraph(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setGraph (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_2setGraph(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_2setGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("setGraph", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":208
 * 
 *     def setGraph(self): #MetaMolecule
 *         self._graph = nx.Graph(name=self.name)             # <<<<<<<<<<<<<<
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 *         #self._graph.add_weighted_edges_from(weightedBondList)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_t_3) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __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;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graph, __pyx_t_3) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":211
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 *         #self._graph.add_weighted_edges_from(weightedBondList)
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 * #             blist = [tok._symbol for tok in bond.atoms()]  # ici ajoute. ???????
 * #             self._graph.add_edge(*blist, weight=bond.bondOrder, bond=bond)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bonds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      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, 211, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":214
 * #             blist = [tok._symbol for tok in bond.atoms()]  # ici ajoute. ???????
 * #             self._graph.add_edge(*blist, weight=bond.bondOrder, bond=bond)
 *             self._graph.add_edge(*bond.atoms(), weight=bond.bondOrder, bond=bond)             # <<<<<<<<<<<<<<
 *         self.invalid = False
 *         return self.graph
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_atoms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_bondOrder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_weight, __pyx_t_7) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bond, __pyx_v_bond) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":211
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 *         #self._graph.add_weighted_edges_from(weightedBondList)
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 * #             blist = [tok._symbol for tok in bond.atoms()]  # ici ajoute. ???????
 * #             self._graph.add_edge(*blist, weight=bond.bondOrder, bond=bond)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":215
 * #             self._graph.add_edge(*blist, weight=bond.bondOrder, bond=bond)
 *             self._graph.add_edge(*bond.atoms(), weight=bond.bondOrder, bond=bond)
 *         self.invalid = False             # <<<<<<<<<<<<<<
 *         return self.graph
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_invalid, Py_False) < 0) __PYX_ERR(0, 215, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":216
 *             self._graph.add_edge(*bond.atoms(), weight=bond.bondOrder, bond=bond)
 *         self.invalid = False
 *         return self.graph             # <<<<<<<<<<<<<<
 * 
 *     @Property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graph_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":207
 *         self.invalid = True
 * 
 *     def setGraph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         self._graph = nx.Graph(name=self.name)
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":219
 * 
 *     @Property
 *     def graph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         if self.invalid:
 *             self.setGraph()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5graph(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5graph = {"graph", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5graph, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5graph(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("graph (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_4graph(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "metaphor/chem_gm/core/metamolecule.py":220
 *     @Property
 *     def graph(self): #MetaMolecule
 *         if self.invalid:             # <<<<<<<<<<<<<<
 *             self.setGraph()
 *         return self._graph
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_invalid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":221
 *     def graph(self): #MetaMolecule
 *         if self.invalid:
 *             self.setGraph()             # <<<<<<<<<<<<<<
 *         return self._graph
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setGraph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __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/metamolecule.py":220
 *     @Property
 *     def graph(self): #MetaMolecule
 *         if self.invalid:             # <<<<<<<<<<<<<<
 *             self.setGraph()
 *         return self._graph
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":222
 *         if self.invalid:
 *             self.setGraph()
 *         return self._graph             # <<<<<<<<<<<<<<
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":219
 * 
 *     @Property
 *     def graph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         if self.invalid:
 *             self.setGraph()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":224
 *         return self._graph
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):             # <<<<<<<<<<<<<<
 *         """Look for the cycles in a molecule.
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7cycles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles[] = "Look for the cycles in a molecule.\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7cycles = {"cycles", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7cycles, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7cycles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ordered = 0;
  PyObject *__pyx_v_asBond = 0;
  PyObject *__pyx_v_commonBonds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cycles (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ordered,&__pyx_n_s_asBond,&__pyx_n_s_commonBonds,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_ordered);
          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_asBond);
          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_commonBonds);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cycles") < 0)) __PYX_ERR(0, 224, __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_ordered = values[1];
    __pyx_v_asBond = values[2];
    __pyx_v_commonBonds = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cycles", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles(__pyx_self, __pyx_v_self, __pyx_v_ordered, __pyx_v_asBond, __pyx_v_commonBonds);

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

/* "metaphor/chem_gm/core/metamolecule.py":230
 *         if ordered:
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)             # <<<<<<<<<<<<<<
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 * 
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_numero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.cycles.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":231
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))             # <<<<<<<<<<<<<<
 * 
 *         if asBond or commonBonds:
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_numero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_numero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_numero); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.cycles.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":224
 *         return self._graph
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):             # <<<<<<<<<<<<<<
 *         """Look for the cycles in a molecule.
 *         """
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ordered, PyObject *__pyx_v_asBond, PyObject *__pyx_v_commonBonds) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_edges_attr = NULL;
  PyObject *__pyx_v_dlst = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_keyinv = NULL;
  PyObject *__pyx_v_res2 = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_loc = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_res3 = NULL;
  PyObject *__pyx_v_clst = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_key = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_val = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_bb = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannySetupContext("cycles", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":227
 *         """Look for the cycles in a molecule.
 *         """
 *         res = nx.cycle_basis(self.graph)             # <<<<<<<<<<<<<<
 *         if ordered:
 *             for ind in range(len(res)):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cycle_basis); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graph_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":228
 *         """
 *         res = nx.cycle_basis(self.graph)
 *         if ordered:             # <<<<<<<<<<<<<<
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ordered); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":229
 *         res = nx.cycle_basis(self.graph)
 *         if ordered:
 *             for ind in range(len(res)):             # <<<<<<<<<<<<<<
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 */
    __pyx_t_7 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 229, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_1);
        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, 229, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":230
 *         if ordered:
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)             # <<<<<<<<<<<<<<
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_res, __pyx_v_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles_lambda1, 0, __pyx_n_s_MetaMolecule_cycles_locals_lambd, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_res, __pyx_v_ind, __pyx_t_2) < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":229
 *         res = nx.cycle_basis(self.graph)
 *         if ordered:
 *             for ind in range(len(res)):             # <<<<<<<<<<<<<<
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":231
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))             # <<<<<<<<<<<<<<
 * 
 *         if asBond or commonBonds:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_res);
    __Pyx_GIVEREF(__pyx_v_res);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_6cycles_1lambda2, 0, __pyx_n_s_MetaMolecule_cycles_locals_lambd, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":228
 *         """
 *         res = nx.cycle_basis(self.graph)
 *         if ordered:             # <<<<<<<<<<<<<<
 *             for ind in range(len(res)):
 *                 res[ind] = sorted(res[ind], key=lambda x: x.numero)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":233
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 * 
 *         if asBond or commonBonds:             # <<<<<<<<<<<<<<
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_asBond); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
  if (!__pyx_t_9) {
  } else {
    __pyx_t_6 = __pyx_t_9;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_commonBonds); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_9;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":234
 * 
 *         if asBond or commonBonds:
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")             # <<<<<<<<<<<<<<
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 *             for key, val in dlst:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_edge_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graph_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_n_u_bond};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_n_u_bond};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_u_bond);
      __Pyx_GIVEREF(__pyx_n_u_bond);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_n_u_bond);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_edges_attr = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":235
 *         if asBond or commonBonds:
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")
 *             dlst = [(key, val) for key, val in edges_attr.items()]             # <<<<<<<<<<<<<<
 *             for key, val in dlst:
 *                 keyinv = (key[1], key[0])
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = 0;
      if (unlikely(__pyx_v_edges_attr == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(0, 235, __pyx_L11_error)
      }
      __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_edges_attr, 0, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;
      while (1) {
        __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_7, &__pyx_t_4, &__pyx_t_2, NULL, __pyx_t_10);
        if (unlikely(__pyx_t_12 == 0)) break;
        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 235, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_key, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_val, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_8genexpr3__pyx_v_key);
        __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_8genexpr3__pyx_v_key);
        __Pyx_INCREF(__pyx_8genexpr3__pyx_v_val);
        __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_val);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_8genexpr3__pyx_v_val);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 235, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key); __pyx_8genexpr3__pyx_v_key = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val); __pyx_8genexpr3__pyx_v_val = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key); __pyx_8genexpr3__pyx_v_key = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val); __pyx_8genexpr3__pyx_v_val = 0;
      goto __pyx_L1_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */
    __pyx_v_dlst = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":236
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 *             for key, val in dlst:             # <<<<<<<<<<<<<<
 *                 keyinv = (key[1], key[0])
 *                 edges_attr[keyinv] = val
 */
    __pyx_t_3 = __pyx_v_dlst; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
    for (;;) {
      if (__pyx_t_11 >= 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_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 236, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 236, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 2) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L18_unpacking_done;
        __pyx_L17_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 236, __pyx_L1_error)
        __pyx_L18_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":237
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 *             for key, val in dlst:
 *                 keyinv = (key[1], key[0])             # <<<<<<<<<<<<<<
 *                 edges_attr[keyinv] = val
 *             res2 = []
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_keyinv, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":238
 *             for key, val in dlst:
 *                 keyinv = (key[1], key[0])
 *                 edges_attr[keyinv] = val             # <<<<<<<<<<<<<<
 *             res2 = []
 *             for lst in res:
 */
      if (unlikely(PyObject_SetItem(__pyx_v_edges_attr, __pyx_v_keyinv, __pyx_v_val) < 0)) __PYX_ERR(0, 238, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":236
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 *             for key, val in dlst:             # <<<<<<<<<<<<<<
 *                 keyinv = (key[1], key[0])
 *                 edges_attr[keyinv] = val
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":239
 *                 keyinv = (key[1], key[0])
 *                 edges_attr[keyinv] = val
 *             res2 = []             # <<<<<<<<<<<<<<
 *             for lst in res:
 *                 lst .append(lst[0])
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res2 = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":240
 *                 edges_attr[keyinv] = val
 *             res2 = []
 *             for lst in res:             # <<<<<<<<<<<<<<
 *                 lst .append(lst[0])
 *                 loc = []
 */
    if (likely(PyList_CheckExact(__pyx_v_res)) || PyTuple_CheckExact(__pyx_v_res)) {
      __pyx_t_3 = __pyx_v_res; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_res); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_11 >= 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_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_11 >= 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_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__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, 240, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":241
 *             res2 = []
 *             for lst in res:
 *                 lst .append(lst[0])             # <<<<<<<<<<<<<<
 *                 loc = []
 *                 for ind in range(len(lst)):
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_t_2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 241, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":242
 *             for lst in res:
 *                 lst .append(lst[0])
 *                 loc = []             # <<<<<<<<<<<<<<
 *                 for ind in range(len(lst)):
 *                     if not ind:
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_loc, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":243
 *                 lst .append(lst[0])
 *                 loc = []
 *                 for ind in range(len(lst)):             # <<<<<<<<<<<<<<
 *                     if not ind:
 *                         continue
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 243, __pyx_L1_error)
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 243, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_15(__pyx_t_2);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 243, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":244
 *                 loc = []
 *                 for ind in range(len(lst)):
 *                     if not ind:             # <<<<<<<<<<<<<<
 *                         continue
 *                     bond = edges_attr[lst[ind-1], lst[ind]]
 */
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ind); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
        __pyx_t_9 = ((!__pyx_t_6) != 0);
        if (__pyx_t_9) {

          /* "metaphor/chem_gm/core/metamolecule.py":245
 *                 for ind in range(len(lst)):
 *                     if not ind:
 *                         continue             # <<<<<<<<<<<<<<
 *                     bond = edges_attr[lst[ind-1], lst[ind]]
 *                     loc.append(bond)
 */
          goto __pyx_L21_continue;

          /* "metaphor/chem_gm/core/metamolecule.py":244
 *                 loc = []
 *                 for ind in range(len(lst)):
 *                     if not ind:             # <<<<<<<<<<<<<<
 *                         continue
 *                     bond = edges_attr[lst[ind-1], lst[ind]]
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":246
 *                     if not ind:
 *                         continue
 *                     bond = edges_attr[lst[ind-1], lst[ind]]             # <<<<<<<<<<<<<<
 *                     loc.append(bond)
 * 
 */
        __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_ind, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
        __pyx_t_1 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_edges_attr, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":247
 *                         continue
 *                     bond = edges_attr[lst[ind-1], lst[ind]]
 *                     loc.append(bond)             # <<<<<<<<<<<<<<
 * 
 * #                 edges = nx.edges(self.graph, lst)
 */
        __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_loc, __pyx_v_bond); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 247, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":243
 *                 lst .append(lst[0])
 *                 loc = []
 *                 for ind in range(len(lst)):             # <<<<<<<<<<<<<<
 *                     if not ind:
 *                         continue
 */
        __pyx_L21_continue:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":251
 * #                 edges = nx.edges(self.graph, lst)
 * #                 loc = [edges_attr[val] for val in edges if val[0] in lst and val[1] in lst]
 *                 res2.append(loc)             # <<<<<<<<<<<<<<
 *             res = res2
 *         if commonBonds:
 */
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res2, __pyx_v_loc); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 251, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":240
 *                 edges_attr[keyinv] = val
 *             res2 = []
 *             for lst in res:             # <<<<<<<<<<<<<<
 *                 lst .append(lst[0])
 *                 loc = []
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":252
 * #                 loc = [edges_attr[val] for val in edges if val[0] in lst and val[1] in lst]
 *                 res2.append(loc)
 *             res = res2             # <<<<<<<<<<<<<<
 *         if commonBonds:
 *             res3 = []
 */
    __Pyx_INCREF(__pyx_v_res2);
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_res2);

    /* "metaphor/chem_gm/core/metamolecule.py":233
 *             res = sorted(res, key=lambda x: (x[0].numero, x[1].numero, x[2].numero))
 * 
 *         if asBond or commonBonds:             # <<<<<<<<<<<<<<
 *             edges_attr = nx.get_edge_attributes(self.graph, "bond")
 *             dlst = [(key, val) for key, val in edges_attr.items()]
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":253
 *                 res2.append(loc)
 *             res = res2
 *         if commonBonds:             # <<<<<<<<<<<<<<
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_commonBonds); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 253, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "metaphor/chem_gm/core/metamolecule.py":254
 *             res = res2
 *         if commonBonds:
 *             res3 = []             # <<<<<<<<<<<<<<
 *             for ind, clst in enumerate(res[:-1]):
 *                 for bond in clst:
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res3 = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":255
 *         if commonBonds:
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):             # <<<<<<<<<<<<<<
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_res, 0, -1L, NULL, NULL, &__pyx_slice__10, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 255, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_4);
        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, 255, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_clst, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_ind, __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, 255, __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/metamolecule.py":256
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):
 *                 for bond in clst:             # <<<<<<<<<<<<<<
 *                     for lst in res[ind+1:]:
 *                         loc = [bb for bb in lst if bb==bond]
 */
      if (likely(PyList_CheckExact(__pyx_v_clst)) || PyTuple_CheckExact(__pyx_v_clst)) {
        __pyx_t_2 = __pyx_v_clst; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_clst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 256, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_15(__pyx_t_2);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 256, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":257
 *             for ind, clst in enumerate(res[:-1]):
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:             # <<<<<<<<<<<<<<
 *                         loc = [bb for bb in lst if bb==bond]
 *                         res3.extend(loc)
 */
        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_ind, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_res, 0, 0, &__pyx_t_5, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_16 = 0;
          __pyx_t_17 = NULL;
        } else {
          __pyx_t_16 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_17 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 257, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_17)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_1); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_1); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_17(__pyx_t_5);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 257, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":258
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:
 *                         loc = [bb for bb in lst if bb==bond]             # <<<<<<<<<<<<<<
 *                         res3.extend(loc)
 *             res = res3
 */
          { /* enter inner scope */
            __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L33_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
              __pyx_t_18 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_18); __pyx_t_19 = 0;
              __pyx_t_20 = NULL;
            } else {
              __pyx_t_19 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 258, __pyx_L33_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_20 = Py_TYPE(__pyx_t_18)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 258, __pyx_L33_error)
            }
            for (;;) {
              if (likely(!__pyx_t_20)) {
                if (likely(PyList_CheckExact(__pyx_t_18))) {
                  if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_18)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_21 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_19); __Pyx_INCREF(__pyx_t_21); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 258, __pyx_L33_error)
                  #else
                  __pyx_t_21 = PySequence_ITEM(__pyx_t_18, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 258, __pyx_L33_error)
                  __Pyx_GOTREF(__pyx_t_21);
                  #endif
                } else {
                  if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_21 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_19); __Pyx_INCREF(__pyx_t_21); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 258, __pyx_L33_error)
                  #else
                  __pyx_t_21 = PySequence_ITEM(__pyx_t_18, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 258, __pyx_L33_error)
                  __Pyx_GOTREF(__pyx_t_21);
                  #endif
                }
              } else {
                __pyx_t_21 = __pyx_t_20(__pyx_t_18);
                if (unlikely(!__pyx_t_21)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 258, __pyx_L33_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_21);
              }
              __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_bb, __pyx_t_21);
              __pyx_t_21 = 0;
              __pyx_t_21 = PyObject_RichCompare(__pyx_8genexpr4__pyx_v_bb, __pyx_v_bond, Py_EQ); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 258, __pyx_L33_error)
              __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 258, __pyx_L33_error)
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              if (__pyx_t_9) {
                if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_bb))) __PYX_ERR(0, 258, __pyx_L33_error)
              }
            }
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_bb); __pyx_8genexpr4__pyx_v_bb = 0;
            goto __pyx_L37_exit_scope;
            __pyx_L33_error:;
            __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_bb); __pyx_8genexpr4__pyx_v_bb = 0;
            goto __pyx_L1_error;
            __pyx_L37_exit_scope:;
          } /* exit inner scope */
          __Pyx_XDECREF_SET(__pyx_v_loc, ((PyObject*)__pyx_t_1));
          __pyx_t_1 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":259
 *                     for lst in res[ind+1:]:
 *                         loc = [bb for bb in lst if bb==bond]
 *                         res3.extend(loc)             # <<<<<<<<<<<<<<
 *             res = res3
 *         return res
 */
          __pyx_t_14 = __Pyx_PyList_Extend(__pyx_v_res3, __pyx_v_loc); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)

          /* "metaphor/chem_gm/core/metamolecule.py":257
 *             for ind, clst in enumerate(res[:-1]):
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:             # <<<<<<<<<<<<<<
 *                         loc = [bb for bb in lst if bb==bond]
 *                         res3.extend(loc)
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":256
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):
 *                 for bond in clst:             # <<<<<<<<<<<<<<
 *                     for lst in res[ind+1:]:
 *                         loc = [bb for bb in lst if bb==bond]
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":255
 *         if commonBonds:
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):             # <<<<<<<<<<<<<<
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":260
 *                         loc = [bb for bb in lst if bb==bond]
 *                         res3.extend(loc)
 *             res = res3             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
    __Pyx_INCREF(__pyx_v_res3);
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_res3);

    /* "metaphor/chem_gm/core/metamolecule.py":253
 *                 res2.append(loc)
 *             res = res2
 *         if commonBonds:             # <<<<<<<<<<<<<<
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":261
 *                         res3.extend(loc)
 *             res = res3
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def closureCandidates(self): #MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":224
 *         return self._graph
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):             # <<<<<<<<<<<<<<
 *         """Look for the cycles in a molecule.
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_edges_attr);
  __Pyx_XDECREF(__pyx_v_dlst);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_keyinv);
  __Pyx_XDECREF(__pyx_v_res2);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_res3);
  __Pyx_XDECREF(__pyx_v_clst);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_bb);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":263
 *         return res
 * 
 *     def closureCandidates(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         res = self.cycles(asBond=True, ordered=True)
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_9closureCandidates(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_9closureCandidates = {"closureCandidates", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_9closureCandidates, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_9closureCandidates(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closureCandidates (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_8closureCandidates(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_8closureCandidates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_commonbonds = NULL;
  PyObject *__pyx_v_resloc = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_lstloc = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("closureCandidates", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":264
 * 
 *     def closureCandidates(self): #MetaMolecule
 *         res = self.cycles(asBond=True, ordered=True)             # <<<<<<<<<<<<<<
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 *         commonbonds = self.cycles(commonBonds=True)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_asBond, Py_True) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ordered, Py_True) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":266
 *         res = self.cycles(asBond=True, ordered=True)
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 *         commonbonds = self.cycles(commonBonds=True)             # <<<<<<<<<<<<<<
 *         resloc = []
 *         for lst in res:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_commonBonds, Py_True) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_commonbonds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":267
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 *         commonbonds = self.cycles(commonBonds=True)
 *         resloc = []             # <<<<<<<<<<<<<<
 *         for lst in res:
 *             # on selectionne les liaaisons non communes si possible
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_resloc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":268
 *         commonbonds = self.cycles(commonBonds=True)
 *         resloc = []
 *         for lst in res:             # <<<<<<<<<<<<<<
 *             # on selectionne les liaaisons non communes si possible
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 */
  if (likely(PyList_CheckExact(__pyx_v_res)) || PyTuple_CheckExact(__pyx_v_res)) {
    __pyx_t_1 = __pyx_v_res; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__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, 268, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":270
 *         for lst in res:
 *             # on selectionne les liaaisons non communes si possible
 *             lstloc = [bond for bond in lst if not bond in commonbonds]             # <<<<<<<<<<<<<<
 *             if not len(lstloc):
 *                 lstloc = lst[:1]
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
        __pyx_t_3 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L7_error)
      }
      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_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, 270, __pyx_L7_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L7_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, 270, __pyx_L7_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__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, 270, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_bond, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr5__pyx_v_bond, __pyx_v_commonbonds, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 270, __pyx_L7_error)
        __pyx_t_10 = (__pyx_t_9 != 0);
        if (__pyx_t_10) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr5__pyx_v_bond))) __PYX_ERR(0, 270, __pyx_L7_error)
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_bond); __pyx_8genexpr5__pyx_v_bond = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_bond); __pyx_8genexpr5__pyx_v_bond = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_lstloc, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":271
 *             # on selectionne les liaaisons non communes si possible
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 *             if not len(lstloc):             # <<<<<<<<<<<<<<
 *                 lstloc = lst[:1]
 *             resloc.append(lstloc)
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_lstloc); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
    __pyx_t_10 = ((!(__pyx_t_6 != 0)) != 0);
    if (__pyx_t_10) {

      /* "metaphor/chem_gm/core/metamolecule.py":272
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 *             if not len(lstloc):
 *                 lstloc = lst[:1]             # <<<<<<<<<<<<<<
 *             resloc.append(lstloc)
 *         res = resloc
 */
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_lst, 0, 1, NULL, NULL, &__pyx_slice__11, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_lstloc, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":271
 *             # on selectionne les liaaisons non communes si possible
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 *             if not len(lstloc):             # <<<<<<<<<<<<<<
 *                 lstloc = lst[:1]
 *             resloc.append(lstloc)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":273
 *             if not len(lstloc):
 *                 lstloc = lst[:1]
 *             resloc.append(lstloc)             # <<<<<<<<<<<<<<
 *         res = resloc
 *         resloc = []
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_resloc, __pyx_v_lstloc); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 273, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":268
 *         commonbonds = self.cycles(commonBonds=True)
 *         resloc = []
 *         for lst in res:             # <<<<<<<<<<<<<<
 *             # on selectionne les liaaisons non communes si possible
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":274
 *                 lstloc = lst[:1]
 *             resloc.append(lstloc)
 *         res = resloc             # <<<<<<<<<<<<<<
 *         resloc = []
 *         for lst in res:
 */
  __Pyx_INCREF(__pyx_v_resloc);
  __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_resloc);

  /* "metaphor/chem_gm/core/metamolecule.py":275
 *             resloc.append(lstloc)
 *         res = resloc
 *         resloc = []             # <<<<<<<<<<<<<<
 *         for lst in res:
 *             lstloc = sorted(lst, key=keyForClosure)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_resloc, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":276
 *         res = resloc
 *         resloc = []
 *         for lst in res:             # <<<<<<<<<<<<<<
 *             lstloc = sorted(lst, key=keyForClosure)
 *             resloc.append(lstloc)
 */
  __pyx_t_1 = __pyx_v_res; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":277
 *         resloc = []
 *         for lst in res:
 *             lstloc = sorted(lst, key=keyForClosure)             # <<<<<<<<<<<<<<
 *             resloc.append(lstloc)
 * #         resloc = []
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_lst);
    __Pyx_GIVEREF(__pyx_v_lst);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_lst);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_keyForClosure); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __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_XDECREF_SET(__pyx_v_lstloc, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":278
 *         for lst in res:
 *             lstloc = sorted(lst, key=keyForClosure)
 *             resloc.append(lstloc)             # <<<<<<<<<<<<<<
 * #         resloc = []
 * #         for lst in res:
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_resloc, __pyx_v_lstloc); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 278, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":276
 *         res = resloc
 *         resloc = []
 *         for lst in res:             # <<<<<<<<<<<<<<
 *             lstloc = sorted(lst, key=keyForClosure)
 *             resloc.append(lstloc)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":287
 * #             resloc.append(lstloc)
 * #         res = resloc
 *         return res             # <<<<<<<<<<<<<<
 * 
 * #         res = [[bond for bond in lst if not bond in commonbonds] for lst in res]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":263
 *         return res
 * 
 *     def closureCandidates(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         res = self.cycles(asBond=True, ordered=True)
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 */

  /* function 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_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.closureCandidates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_commonbonds);
  __Pyx_XDECREF(__pyx_v_resloc);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_lstloc);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":314
 * 
 * 
 *     def kekulize(self, action=False): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Transform an aromatic molecule to its Kekule representation
 *         !!!  To be checked  !!!
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11kekulize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_10kekulize[] = "Transform an aromatic molecule to its Kekule representation\n        !!!  To be checked  !!!\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11kekulize = {"kekulize", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11kekulize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_10kekulize};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11kekulize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_action = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("kekulize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_action,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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_action);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kekulize") < 0)) __PYX_ERR(0, 314, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_action = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("kekulize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 314, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.kekulize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_10kekulize(__pyx_self, __pyx_v_self, __pyx_v_action);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_10kekulize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_action) {
  PyObject *__pyx_v_bondss = NULL;
  PyObject *__pyx_v_atomss = NULL;
  PyObject *__pyx_v_atoms = NULL;
  PyObject *__pyx_v_bonds = NULL;
  PyObject *__pyx_v_conds = NULL;
  PyObject *__pyx_v_cond = NULL;
  PyObject *__pyx_v_condbonds = NULL;
  int __pyx_v_condbond;
  PyObject *__pyx_v_atom = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_type0 = NULL;
  PyObject *__pyx_v_type1 = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_atom = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_bond = 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)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("kekulize", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":318
 *         !!!  To be checked  !!!
 *         """
 *         bondss = self.cycles(ordered=True, asBond=True)             # <<<<<<<<<<<<<<
 *         atomss = self.cycles(ordered=True, asBond=False)
 *         #liste des cycles de liaisons ordonnes
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ordered, Py_True) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_asBond, Py_True) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_bondss = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":319
 *         """
 *         bondss = self.cycles(ordered=True, asBond=True)
 *         atomss = self.cycles(ordered=True, asBond=False)             # <<<<<<<<<<<<<<
 *         #liste des cycles de liaisons ordonnes
 *         if action:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ordered, Py_True) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_asBond, Py_False) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_atomss = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":321
 *         atomss = self.cycles(ordered=True, asBond=False)
 *         #liste des cycles de liaisons ordonnes
 *         if action:             # <<<<<<<<<<<<<<
 *             #
 *             for atoms, bonds in zip(atomss, bondss):
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_action); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "metaphor/chem_gm/core/metamolecule.py":323
 *         if action:
 *             #
 *             for atoms, bonds in zip(atomss, bondss):             # <<<<<<<<<<<<<<
 *                 conds = [not atom.aromatic for atom in atoms]
 *                 cond = not any(conds)
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_atomss);
    __Pyx_GIVEREF(__pyx_v_atomss);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_atomss);
    __Pyx_INCREF(__pyx_v_bondss);
    __Pyx_GIVEREF(__pyx_v_bondss);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_bondss);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __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, 323, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    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, 323, __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, 323, __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, 323, __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, 323, __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, 323, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 323, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 323, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_atoms, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_bonds, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":324
 *             #
 *             for atoms, bonds in zip(atomss, bondss):
 *                 conds = [not atom.aromatic for atom in atoms]             # <<<<<<<<<<<<<<
 *                 cond = not any(conds)
 *                 cond = cond and not (len(bonds) % 2)
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(PyList_CheckExact(__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_v_atoms)) {
          __pyx_t_7 = __pyx_v_atoms; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_atoms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 324, __pyx_L10_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 324, __pyx_L10_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 324, __pyx_L10_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_11(__pyx_t_7);
            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, 324, __pyx_L10_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_atom, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_atom, __pyx_n_s_aromatic); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 324, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 324, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_atom); __pyx_8genexpr6__pyx_v_atom = 0;
        goto __pyx_L13_exit_scope;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_atom); __pyx_8genexpr6__pyx_v_atom = 0;
        goto __pyx_L1_error;
        __pyx_L13_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_conds, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":325
 *             for atoms, bonds in zip(atomss, bondss):
 *                 conds = [not atom.aromatic for atom in atoms]
 *                 cond = not any(conds)             # <<<<<<<<<<<<<<
 *                 cond = cond and not (len(bonds) % 2)
 *                 condbonds = [not bond.bondType==AROMATIC_BOND for bond in bonds]
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_v_conds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __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, 325, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":326
 *                 conds = [not atom.aromatic for atom in atoms]
 *                 cond = not any(conds)
 *                 cond = cond and not (len(bonds) % 2)             # <<<<<<<<<<<<<<
 *                 condbonds = [not bond.bondType==AROMATIC_BOND for bond in bonds]
 *                 condbond = not any(condbonds)
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
      if (__pyx_t_4) {
      } else {
        __Pyx_INCREF(__pyx_v_cond);
        __pyx_t_2 = __pyx_v_cond;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_10 = PyObject_Length(__pyx_v_bonds); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 326, __pyx_L1_error)
      __pyx_t_4 = (!(__Pyx_mod_Py_ssize_t(__pyx_t_10, 2) != 0));
      __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __pyx_t_7;
      __pyx_t_7 = 0;
      __pyx_L14_bool_binop_done:;
      __Pyx_DECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":327
 *                 cond = not any(conds)
 *                 cond = cond and not (len(bonds) % 2)
 *                 condbonds = [not bond.bondType==AROMATIC_BOND for bond in bonds]             # <<<<<<<<<<<<<<
 *                 condbond = not any(condbonds)
 *                 cond = cond and condbond
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(PyList_CheckExact(__pyx_v_bonds)) || PyTuple_CheckExact(__pyx_v_bonds)) {
          __pyx_t_7 = __pyx_v_bonds; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_bonds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 327, __pyx_L18_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 327, __pyx_L18_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 327, __pyx_L18_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_11(__pyx_t_7);
            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, 327, __pyx_L18_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_bond, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_bond, __pyx_n_s_bondType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_AROMATIC_BOND); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyBool_FromLong((!__pyx_t_4)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 327, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_bond); __pyx_8genexpr7__pyx_v_bond = 0;
        goto __pyx_L21_exit_scope;
        __pyx_L18_error:;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_bond); __pyx_8genexpr7__pyx_v_bond = 0;
        goto __pyx_L1_error;
        __pyx_L21_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_condbonds, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":328
 *                 cond = cond and not (len(bonds) % 2)
 *                 condbonds = [not bond.bondType==AROMATIC_BOND for bond in bonds]
 *                 condbond = not any(condbonds)             # <<<<<<<<<<<<<<
 *                 cond = cond and condbond
 *                 if cond:
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_v_condbonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __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, 328, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_condbond = (!__pyx_t_4);

      /* "metaphor/chem_gm/core/metamolecule.py":329
 *                 condbonds = [not bond.bondType==AROMATIC_BOND for bond in bonds]
 *                 condbond = not any(condbonds)
 *                 cond = cond and condbond             # <<<<<<<<<<<<<<
 *                 if cond:
 *                     for atom in atoms:
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
      if (__pyx_t_4) {
      } else {
        __Pyx_INCREF(__pyx_v_cond);
        __pyx_t_2 = __pyx_v_cond;
        goto __pyx_L22_bool_binop_done;
      }
      __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_condbond); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __pyx_t_7;
      __pyx_t_7 = 0;
      __pyx_L22_bool_binop_done:;
      __Pyx_DECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":330
 *                 condbond = not any(condbonds)
 *                 cond = cond and condbond
 *                 if cond:             # <<<<<<<<<<<<<<
 *                     for atom in atoms:
 *                         atom._aromatic = False
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/metamolecule.py":331
 *                 cond = cond and condbond
 *                 if cond:
 *                     for atom in atoms:             # <<<<<<<<<<<<<<
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):
 */
        if (likely(PyList_CheckExact(__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_v_atoms)) {
          __pyx_t_2 = __pyx_v_atoms; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_atoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_2))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_11(__pyx_t_2);
            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, 331, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_v_atom, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":332
 *                 if cond:
 *                     for atom in atoms:
 *                         atom._aromatic = False             # <<<<<<<<<<<<<<
 *                     for ind, bond in enumerate(bonds):
 *                         if ind % 2:
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_atom, __pyx_n_s_aromatic_2, Py_False) < 0) __PYX_ERR(0, 332, __pyx_L1_error)

          /* "metaphor/chem_gm/core/metamolecule.py":331
 *                 cond = cond and condbond
 *                 if cond:
 *                     for atom in atoms:             # <<<<<<<<<<<<<<
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):
 */
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":333
 *                     for atom in atoms:
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):             # <<<<<<<<<<<<<<
 *                         if ind % 2:
 *                             bond.bondType = SINGLE_BOND
 */
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_2 = __pyx_int_0;
        if (likely(PyList_CheckExact(__pyx_v_bonds)) || PyTuple_CheckExact(__pyx_v_bonds)) {
          __pyx_t_7 = __pyx_v_bonds; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_bonds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 333, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 333, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            }
          } else {
            __pyx_t_12 = __pyx_t_11(__pyx_t_7);
            if (unlikely(!__pyx_t_12)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 333, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_12);
          __pyx_t_12 = 0;
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_2);
          __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 333, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_2);
          __pyx_t_2 = __pyx_t_12;
          __pyx_t_12 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":334
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):
 *                         if ind % 2:             # <<<<<<<<<<<<<<
 *                             bond.bondType = SINGLE_BOND
 *                         else:
 */
          __pyx_t_12 = __Pyx_PyInt_RemainderObjC(__pyx_v_ind, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_4) {

            /* "metaphor/chem_gm/core/metamolecule.py":335
 *                     for ind, bond in enumerate(bonds):
 *                         if ind % 2:
 *                             bond.bondType = SINGLE_BOND             # <<<<<<<<<<<<<<
 *                         else:
 *                             bond.bondType = DOUBLE_BOND
 */
            __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 335, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_bond, __pyx_n_s_bondType, __pyx_t_12) < 0) __PYX_ERR(0, 335, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":334
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):
 *                         if ind % 2:             # <<<<<<<<<<<<<<
 *                             bond.bondType = SINGLE_BOND
 *                         else:
 */
            goto __pyx_L29;
          }

          /* "metaphor/chem_gm/core/metamolecule.py":337
 *                             bond.bondType = SINGLE_BOND
 *                         else:
 *                             bond.bondType = DOUBLE_BOND             # <<<<<<<<<<<<<<
 *         else:
 *             for atoms, bonds in zip(atomss, bondss):
 */
          /*else*/ {
            __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE_BOND); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_bond, __pyx_n_s_bondType, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __pyx_L29:;

          /* "metaphor/chem_gm/core/metamolecule.py":333
 *                     for atom in atoms:
 *                         atom._aromatic = False
 *                     for ind, bond in enumerate(bonds):             # <<<<<<<<<<<<<<
 *                         if ind % 2:
 *                             bond.bondType = SINGLE_BOND
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":330
 *                 condbond = not any(condbonds)
 *                 cond = cond and condbond
 *                 if cond:             # <<<<<<<<<<<<<<
 *                     for atom in atoms:
 *                         atom._aromatic = False
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":323
 *         if action:
 *             #
 *             for atoms, bonds in zip(atomss, bondss):             # <<<<<<<<<<<<<<
 *                 conds = [not atom.aromatic for atom in atoms]
 *                 cond = not any(conds)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":321
 *         atomss = self.cycles(ordered=True, asBond=False)
 *         #liste des cycles de liaisons ordonnes
 *         if action:             # <<<<<<<<<<<<<<
 *             #
 *             for atoms, bonds in zip(atomss, bondss):
 */
    goto __pyx_L3;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":339
 *                             bond.bondType = DOUBLE_BOND
 *         else:
 *             for atoms, bonds in zip(atomss, bondss):             # <<<<<<<<<<<<<<
 *                 cond = not (len(bonds) % 2)
 *                 #bondext = bonds.copy()
 */
  /*else*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_atomss);
    __Pyx_GIVEREF(__pyx_v_atomss);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_atomss);
    __Pyx_INCREF(__pyx_v_bondss);
    __Pyx_GIVEREF(__pyx_v_bondss);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_bondss);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __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, 339, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 339, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L32_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_12 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_12)) goto __pyx_L32_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L33_unpacking_done;
        __pyx_L32_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 339, __pyx_L1_error)
        __pyx_L33_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_atoms, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_bonds, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":340
 *         else:
 *             for atoms, bonds in zip(atomss, bondss):
 *                 cond = not (len(bonds) % 2)             # <<<<<<<<<<<<<<
 *                 #bondext = bonds.copy()
 *                 #bondext.append(bondext[0])
 */
      __pyx_t_10 = PyObject_Length(__pyx_v_bonds); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 340, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong((!(__Pyx_mod_Py_ssize_t(__pyx_t_10, 2) != 0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":343
 *                 #bondext = bonds.copy()
 *                 #bondext.append(bondext[0])
 *                 type0 = bonds[0].bondType             # <<<<<<<<<<<<<<
 *                 type1 = bonds[1].bondType
 *                 cond = type0 != type1
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bonds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bondType); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_type0, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":344
 *                 #bondext.append(bondext[0])
 *                 type0 = bonds[0].bondType
 *                 type1 = bonds[1].bondType             # <<<<<<<<<<<<<<
 *                 cond = type0 != type1
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]
 */
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_bonds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_bondType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_type1, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":345
 *                 type0 = bonds[0].bondType
 *                 type1 = bonds[1].bondType
 *                 cond = type0 != type1             # <<<<<<<<<<<<<<
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_type0, __pyx_v_type1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":346
 *                 type1 = bonds[1].bondType
 *                 cond = type0 != type1
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]             # <<<<<<<<<<<<<<
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 *                 if cond:
 */
      __Pyx_INCREF(__pyx_v_type0);
      __pyx_t_2 = __pyx_v_type0;
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_13) {
      } else {
        __pyx_t_4 = __pyx_t_13;
        goto __pyx_L34_bool_binop_done;
      }
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE_BOND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_4 = __pyx_t_13;
      __pyx_L34_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":347
 *                 cond = type0 != type1
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]             # <<<<<<<<<<<<<<
 *                 if cond:
 *                     for atom in atoms:
 */
      __Pyx_INCREF(__pyx_v_type1);
      __pyx_t_2 = __pyx_v_type1;
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_13) {
      } else {
        __pyx_t_4 = __pyx_t_13;
        goto __pyx_L36_bool_binop_done;
      }
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE_BOND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_4 = __pyx_t_13;
      __pyx_L36_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_cond, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":348
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 *                 if cond:             # <<<<<<<<<<<<<<
 *                     for atom in atoms:
 *                         atom.aromatic = True
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cond); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 348, __pyx_L1_error)
      if (__pyx_t_4) {

        /* "metaphor/chem_gm/core/metamolecule.py":349
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 *                 if cond:
 *                     for atom in atoms:             # <<<<<<<<<<<<<<
 *                         atom.aromatic = True
 *                     for bond in bonds:
 */
        if (likely(PyList_CheckExact(__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_v_atoms)) {
          __pyx_t_2 = __pyx_v_atoms; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_atoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 349, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_2))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 349, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 349, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            }
          } else {
            __pyx_t_12 = __pyx_t_11(__pyx_t_2);
            if (unlikely(!__pyx_t_12)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 349, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_XDECREF_SET(__pyx_v_atom, __pyx_t_12);
          __pyx_t_12 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":350
 *                 if cond:
 *                     for atom in atoms:
 *                         atom.aromatic = True             # <<<<<<<<<<<<<<
 *                     for bond in bonds:
 *                         bond.bondType = AROMATIC_BOND
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_atom, __pyx_n_s_aromatic, Py_True) < 0) __PYX_ERR(0, 350, __pyx_L1_error)

          /* "metaphor/chem_gm/core/metamolecule.py":349
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 *                 if cond:
 *                     for atom in atoms:             # <<<<<<<<<<<<<<
 *                         atom.aromatic = True
 *                     for bond in bonds:
 */
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":351
 *                     for atom in atoms:
 *                         atom.aromatic = True
 *                     for bond in bonds:             # <<<<<<<<<<<<<<
 *                         bond.bondType = AROMATIC_BOND
 * 
 */
        if (likely(PyList_CheckExact(__pyx_v_bonds)) || PyTuple_CheckExact(__pyx_v_bonds)) {
          __pyx_t_2 = __pyx_v_bonds; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_bonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_2))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 351, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 351, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            }
          } else {
            __pyx_t_12 = __pyx_t_11(__pyx_t_2);
            if (unlikely(!__pyx_t_12)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 351, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_12);
          __pyx_t_12 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":352
 *                         atom.aromatic = True
 *                     for bond in bonds:
 *                         bond.bondType = AROMATIC_BOND             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_AROMATIC_BOND); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 352, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_bond, __pyx_n_s_bondType, __pyx_t_12) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":351
 *                     for atom in atoms:
 *                         atom.aromatic = True
 *                     for bond in bonds:             # <<<<<<<<<<<<<<
 *                         bond.bondType = AROMATIC_BOND
 * 
 */
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":348
 *                 cond = type0 in [SINGLE_BOND, DOUBLE_BOND]
 *                 cond = type1 in [SINGLE_BOND, DOUBLE_BOND]
 *                 if cond:             # <<<<<<<<<<<<<<
 *                     for atom in atoms:
 *                         atom.aromatic = True
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":339
 *                             bond.bondType = DOUBLE_BOND
 *         else:
 *             for atoms, bonds in zip(atomss, bondss):             # <<<<<<<<<<<<<<
 *                 cond = not (len(bonds) % 2)
 *                 #bondext = bonds.copy()
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "metaphor/chem_gm/core/metamolecule.py":314
 * 
 * 
 *     def kekulize(self, action=False): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Transform an aromatic molecule to its Kekule representation
 *         !!!  To be checked  !!!
 */

  /* 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_12);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.kekulize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bondss);
  __Pyx_XDECREF(__pyx_v_atomss);
  __Pyx_XDECREF(__pyx_v_atoms);
  __Pyx_XDECREF(__pyx_v_bonds);
  __Pyx_XDECREF(__pyx_v_conds);
  __Pyx_XDECREF(__pyx_v_cond);
  __Pyx_XDECREF(__pyx_v_condbonds);
  __Pyx_XDECREF(__pyx_v_atom);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_type0);
  __Pyx_XDECREF(__pyx_v_type1);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_atom);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":355
 * 
 * 
 *     def remove(self, target): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove an atom from the molecule
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_13remove(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_12remove[] = "Remove an atom from the molecule\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_13remove = {"remove", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_13remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_12remove};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_13remove(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_target,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, 1); __PYX_ERR(0, 355, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove") < 0)) __PYX_ERR(0, 355, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_target = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 355, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_12remove(__pyx_self, __pyx_v_self, __pyx_v_target);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_12remove(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target) {
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("remove", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":358
 *         """Remove an atom from the molecule
 *         """
 *         for bond in target.cbonds:             # <<<<<<<<<<<<<<
 *             bond.linkedto(target).cbonds.remove(bond)
 *             #if self in val.bonds:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 358, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 358, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 358, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":359
 *         """
 *         for bond in target.cbonds:
 *             bond.linkedto(target).cbonds.remove(bond)             # <<<<<<<<<<<<<<
 *             #if self in val.bonds:
 *             #val.bonds.remove(target)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_target); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_target};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_target};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_target);
        __Pyx_GIVEREF(__pyx_v_target);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_target);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_bond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_bond};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_bond};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_bond);
        __Pyx_GIVEREF(__pyx_v_bond);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_bond);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":358
 *         """Remove an atom from the molecule
 *         """
 *         for bond in target.cbonds:             # <<<<<<<<<<<<<<
 *             bond.linkedto(target).cbonds.remove(bond)
 *             #if self in val.bonds:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":362
 *             #if self in val.bonds:
 *             #val.bonds.remove(target)
 *         self.__smitokens.remove(target)             # <<<<<<<<<<<<<<
 *         #for i, tok in enumerate(self.__smitokens):
 *         #    tok._numero = i
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_target};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_target};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_target);
      __Pyx_GIVEREF(__pyx_v_target);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_target);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":365
 *         #for i, tok in enumerate(self.__smitokens):
 *         #    tok._numero = i
 *         self.invalid = True             # <<<<<<<<<<<<<<
 * 
 *     def normalizeNumeros(self): #MetaMolecule
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_invalid, Py_True) < 0) __PYX_ERR(0, 365, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":355
 * 
 * 
 *     def remove(self, target): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove an atom from the molecule
 *         """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":367
 *         self.invalid = True
 * 
 *     def normalizeNumeros(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(self.__smitokens):
 *             #if tok.numero > ind:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_15normalizeNumeros(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_15normalizeNumeros = {"normalizeNumeros", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_15normalizeNumeros, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_15normalizeNumeros(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalizeNumeros (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14normalizeNumeros(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14normalizeNumeros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("normalizeNumeros", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":368
 * 
 *     def normalizeNumeros(self): #MetaMolecule
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             #if tok.numero > ind:
 *             tok._numero = ind
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__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, 368, __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_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":370
 *         for ind, tok in enumerate(self.__smitokens):
 *             #if tok.numero > ind:
 *             tok._numero = ind             # <<<<<<<<<<<<<<
 * 
 *     def getBrokenBonds(self): #MetaMolecule
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_numero_2, __pyx_v_ind) < 0) __PYX_ERR(0, 370, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":368
 * 
 *     def normalizeNumeros(self): #MetaMolecule
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             #if tok.numero > ind:
 *             tok._numero = ind
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":367
 *         self.invalid = True
 * 
 *     def normalizeNumeros(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(self.__smitokens):
 *             #if tok.numero > ind:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.normalizeNumeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":372
 *             tok._numero = ind
 * 
 *     def getBrokenBonds(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generator of the broken bonds in molecule
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_17getBrokenBonds(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16getBrokenBonds[] = "Generator of the broken bonds in molecule\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_17getBrokenBonds = {"getBrokenBonds", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_17getBrokenBonds, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16getBrokenBonds};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_17getBrokenBonds(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getBrokenBonds (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16getBrokenBonds(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16getBrokenBonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("getBrokenBonds", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":375
 *         """Generator of the broken bonds in molecule
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         for tok in self:
 *             for bond in tok.cbonds:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":376
 *         """
 *         res = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in res:
 */
  if (likely(PyList_CheckExact(__pyx_v_self)) || PyTuple_CheckExact(__pyx_v_self)) {
    __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 376, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":377
 *         res = []
 *         for tok in self:
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if bond.broken and not bond in res:
 *                     res.append(bond)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 377, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":378
 *         for tok in self:
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in res:             # <<<<<<<<<<<<<<
 *                     res.append(bond)
 *         return res
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_broken); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_bond, __pyx_v_res, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
      __pyx_t_10 = (__pyx_t_9 != 0);
      __pyx_t_8 = __pyx_t_10;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":379
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in res:
 *                     res.append(bond)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_bond); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 379, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":378
 *         for tok in self:
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in res:             # <<<<<<<<<<<<<<
 *                     res.append(bond)
 *         return res
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":377
 *         res = []
 *         for tok in self:
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if bond.broken and not bond in res:
 *                     res.append(bond)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":376
 *         """
 *         res = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in res:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":380
 *                 if bond.broken and not bond in res:
 *                     res.append(bond)
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":372
 *             tok._numero = ind
 * 
 *     def getBrokenBonds(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generator of the broken bonds in molecule
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getBrokenBonds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16__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(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isoalgo);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isoalgo);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isoalgo);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __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.metamolecule.__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_12metamolecule_12MetaMolecule_19postprocess(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_19postprocess = {"postprocess", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_19postprocess, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_19postprocess(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_isoalgo = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postprocess (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_isoalgo,&__pyx_n_s_fullH,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_isoalgo;
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (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_isoalgo);
          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_fullH);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "postprocess") < 0)) __PYX_ERR(0, 382, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_isoalgo = values[1];
    __pyx_v_fullH = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postprocess", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 382, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.postprocess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_18postprocess(__pyx_self, __pyx_v_self, __pyx_v_isoalgo, __pyx_v_fullH);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":385
 *         self.invalid = True
 *         # normalisation des chiral
 *         lst = (tok for tok in self if tok.chiral)             # <<<<<<<<<<<<<<
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 385, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MetaMolecule_postprocess_locals, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.postprocess.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 385, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 385, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 385, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tok);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tok, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tok);
      __pyx_r = __pyx_cur_scope->__pyx_v_tok;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 385, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_18postprocess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isoalgo, PyObject *__pyx_v_fullH) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *__pyx_cur_scope;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_existingH = NULL;
  PyObject *__pyx_v_missingH = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_Htok = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_holder = NULL;
  PyObject *__pyx_v_rawisolist = NULL;
  PyObject *__pyx_v_rawisogroups = NULL;
  int __pyx_v_found;
  PyObject *__pyx_v_tok2 = NULL;
  PyObject *__pyx_v_lsti = NULL;
  PyObject *__pyx_v_isolatedindex = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_cur = NULL;
  long __pyx_v_iso;
  PyObject *__pyx_8genexpr9__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_bond = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  long __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("postprocess", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 382, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "metaphor/chem_gm/core/metamolecule.py":383
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule
 *         self.invalid = True             # <<<<<<<<<<<<<<
 *         # normalisation des chiral
 *         lst = (tok for tok in self if tok.chiral)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_invalid, Py_True) < 0) __PYX_ERR(0, 383, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":385
 *         self.invalid = True
 *         # normalisation des chiral
 *         lst = (tok for tok in self if tok.chiral)             # <<<<<<<<<<<<<<
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:
 */
  __pyx_t_1 = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11postprocess_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":387
 *         lst = (tok for tok in self if tok.chiral)
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:             # <<<<<<<<<<<<<<
 *             tok.normalizeChiral()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
    __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 387, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":388
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:
 *             tok.normalizeChiral()             # <<<<<<<<<<<<<<
 * 
 *         # traitement 1 des hcount
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_normalizeChiral); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":387
 *         lst = (tok for tok in self if tok.chiral)
 *         #bbonds = self.getBrokenBonds()
 *         for tok in lst:             # <<<<<<<<<<<<<<
 *             tok.normalizeChiral()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":391
 * 
 *         # traitement 1 des hcount
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             if tok.symbol in Hydrogenes:
 *                 tok._hcount = 0
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_self)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 391, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":392
 *         # traitement 1 des hcount
 *         for tok in self:
 *             if tok.symbol in Hydrogenes:             # <<<<<<<<<<<<<<
 *                 tok._hcount = 0
 *         # traitement 2 des hcount
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hydrogenes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":393
 *         for tok in self:
 *             if tok.symbol in Hydrogenes:
 *                 tok._hcount = 0             # <<<<<<<<<<<<<<
 *         # traitement 2 des hcount
 *         if fullH:
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_hcount, __pyx_int_0) < 0) __PYX_ERR(0, 393, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":392
 *         # traitement 1 des hcount
 *         for tok in self:
 *             if tok.symbol in Hydrogenes:             # <<<<<<<<<<<<<<
 *                 tok._hcount = 0
 *         # traitement 2 des hcount
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":391
 * 
 *         # traitement 1 des hcount
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             if tok.symbol in Hydrogenes:
 *                 tok._hcount = 0
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":395
 *                 tok._hcount = 0
 *         # traitement 2 des hcount
 *         if fullH:             # <<<<<<<<<<<<<<
 *             # on ajoute les atomes H qui manquent
 *             lst = [tok for tok in self if tok.symbol != "H"]
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_fullH); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 395, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "metaphor/chem_gm/core/metamolecule.py":397
 *         if fullH:
 *             # on ajoute les atomes H qui manquent
 *             lst = [tok for tok in self if tok.symbol != "H"]             # <<<<<<<<<<<<<<
 *             for tok in lst:
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_self)) {
        __pyx_t_5 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
        __pyx_t_3 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L11_error)
      }
      for (;;) {
        if (likely(!__pyx_t_3)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L11_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L11_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_3(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 397, __pyx_L11_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_tok, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr9__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_H, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 397, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_8) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr9__pyx_v_tok))) __PYX_ERR(0, 397, __pyx_L11_error)
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_tok); __pyx_8genexpr9__pyx_v_tok = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_tok); __pyx_8genexpr9__pyx_v_tok = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":398
 *             # on ajoute les atomes H qui manquent
 *             lst = [tok for tok in self if tok.symbol != "H"]
 *             for tok in lst:             # <<<<<<<<<<<<<<
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 */
    __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 398, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":399
 *             lst = [tok for tok in self if tok.symbol != "H"]
 *             for tok in lst:
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici             # <<<<<<<<<<<<<<
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 *                 for _ in range(missingH):
 */
      { /* enter inner scope */
        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
          __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
          __pyx_t_3 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L20_error)
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (likely(!__pyx_t_3)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L20_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L20_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_3(__pyx_t_6);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 399, __pyx_L20_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_bond, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr10__pyx_v_bond, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_10, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_tok); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_tok};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_tok};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
              __Pyx_INCREF(__pyx_v_tok);
              __Pyx_GIVEREF(__pyx_v_tok);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_tok);
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_symbol); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_10, __pyx_n_u_H, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 399, __pyx_L20_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_8) {
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr10__pyx_v_bond, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_12) {
              __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tok); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_10);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_tok};
                __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_10);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_tok};
                __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_10);
              } else
              #endif
              {
                __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 399, __pyx_L20_error)
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __pyx_t_12 = NULL;
                __Pyx_INCREF(__pyx_v_tok);
                __Pyx_GIVEREF(__pyx_v_tok);
                PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_tok);
                __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L20_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 399, __pyx_L20_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_bond); __pyx_9genexpr10__pyx_v_bond = 0;
        goto __pyx_L24_exit_scope;
        __pyx_L20_error:;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_bond); __pyx_9genexpr10__pyx_v_bond = 0;
        goto __pyx_L1_error;
        __pyx_L24_exit_scope:;
      } /* exit inner scope */
      __pyx_t_9 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_existingH, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":400
 *             for tok in lst:
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 *                 missingH = max(0, tok.valence - tok.grade - existingH)             # <<<<<<<<<<<<<<
 *                 for _ in range(missingH):
 *                     Htok = SmiToken(self, -1, "H")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_valence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_t_10, __pyx_v_existingH); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = 0;
      __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_10 = __pyx_t_6;
      } else {
        __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_t_10;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_missingH, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":401
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 *                 for _ in range(missingH):             # <<<<<<<<<<<<<<
 *                     Htok = SmiToken(self, -1, "H")
 *                     bond = Htok.setcbondto(tok)
 */
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_missingH); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_10 = __pyx_t_6; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0;
        __pyx_t_3 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_3)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_3(__pyx_t_10);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 401, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":402
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 *                 for _ in range(missingH):
 *                     Htok = SmiToken(self, -1, "H")             # <<<<<<<<<<<<<<
 *                     bond = Htok.setcbondto(tok)
 *                     if tok.chiral:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiToken); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_int_neg_1, __pyx_n_u_H};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_int_neg_1, __pyx_n_u_H};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 402, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_self);
          __Pyx_INCREF(__pyx_int_neg_1);
          __Pyx_GIVEREF(__pyx_int_neg_1);
          PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_14, __pyx_int_neg_1);
          __Pyx_INCREF(__pyx_n_u_H);
          __Pyx_GIVEREF(__pyx_n_u_H);
          PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_14, __pyx_n_u_H);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_Htok, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":403
 *                 for _ in range(missingH):
 *                     Htok = SmiToken(self, -1, "H")
 *                     bond = Htok.setcbondto(tok)             # <<<<<<<<<<<<<<
 *                     if tok.chiral:
 *                         index = tok.cbonds.index(bond)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_Htok, __pyx_n_s_setcbondto); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tok); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __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_11, __pyx_v_tok};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 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_11, __pyx_v_tok};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
            __Pyx_INCREF(__pyx_v_tok);
            __Pyx_GIVEREF(__pyx_v_tok);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_tok);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":404
 *                     Htok = SmiToken(self, -1, "H")
 *                     bond = Htok.setcbondto(tok)
 *                     if tok.chiral:             # <<<<<<<<<<<<<<
 *                         index = tok.cbonds.index(bond)
 *                         tok._absolutechiral = _12absolute(tok._absolutechiral, (index+1) % 2)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_8) {

          /* "metaphor/chem_gm/core/metamolecule.py":405
 *                     bond = Htok.setcbondto(tok)
 *                     if tok.chiral:
 *                         index = tok.cbonds.index(bond)             # <<<<<<<<<<<<<<
 *                         tok._absolutechiral = _12absolute(tok._absolutechiral, (index+1) % 2)
 * 
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          if (!__pyx_t_4) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_bond); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_bond};
              __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_bond};
              __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else
            #endif
            {
              __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 405, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
              __Pyx_INCREF(__pyx_v_bond);
              __Pyx_GIVEREF(__pyx_v_bond);
              PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_bond);
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":406
 *                     if tok.chiral:
 *                         index = tok.cbonds.index(bond)
 *                         tok._absolutechiral = _12absolute(tok._absolutechiral, (index+1) % 2)             # <<<<<<<<<<<<<<
 * 
 *                     self.insert(tok.numero+1, Htok)
 */
          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_12absolute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_absolutechiral); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = __Pyx_PyInt_RemainderObjC(__pyx_t_4, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = NULL;
          __pyx_t_14 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_14 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_5)) {
            PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_11, __pyx_t_12};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
            PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_11, __pyx_t_12};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            if (__pyx_t_4) {
              __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_12);
            __pyx_t_11 = 0;
            __pyx_t_12 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_absolutechiral, __pyx_t_6) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":404
 *                     Htok = SmiToken(self, -1, "H")
 *                     bond = Htok.setcbondto(tok)
 *                     if tok.chiral:             # <<<<<<<<<<<<<<
 *                         index = tok.cbonds.index(bond)
 *                         tok._absolutechiral = _12absolute(tok._absolutechiral, (index+1) % 2)
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":408
 *                         tok._absolutechiral = _12absolute(tok._absolutechiral, (index+1) % 2)
 * 
 *                     self.insert(tok.numero+1, Htok)             # <<<<<<<<<<<<<<
 *                     if tok.hcount:
 *                         tok._hcount -= 1
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_insert); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_14 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_12, __pyx_v_Htok};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_12, __pyx_v_Htok};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (__pyx_t_15) {
            __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15); __pyx_t_15 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_14, __pyx_t_12);
          __Pyx_INCREF(__pyx_v_Htok);
          __Pyx_GIVEREF(__pyx_v_Htok);
          PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_14, __pyx_v_Htok);
          __pyx_t_12 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":409
 * 
 *                     self.insert(tok.numero+1, Htok)
 *                     if tok.hcount:             # <<<<<<<<<<<<<<
 *                         tok._hcount -= 1
 *                     self.normalizeNumeros()
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_hcount_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_8) {

          /* "metaphor/chem_gm/core/metamolecule.py":410
 *                     self.insert(tok.numero+1, Htok)
 *                     if tok.hcount:
 *                         tok._hcount -= 1             # <<<<<<<<<<<<<<
 *                     self.normalizeNumeros()
 *         else:
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_hcount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_hcount, __pyx_t_5) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":409
 * 
 *                     self.insert(tok.numero+1, Htok)
 *                     if tok.hcount:             # <<<<<<<<<<<<<<
 *                         tok._hcount -= 1
 *                     self.normalizeNumeros()
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":411
 *                     if tok.hcount:
 *                         tok._hcount -= 1
 *                     self.normalizeNumeros()             # <<<<<<<<<<<<<<
 *         else:
 *             # on supprime les atomes H (ceux qui sont en [H] dans le smiles)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_normalizeNumeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (__pyx_t_11) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":401
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 *                 for _ in range(missingH):             # <<<<<<<<<<<<<<
 *                     Htok = SmiToken(self, -1, "H")
 *                     bond = Htok.setcbondto(tok)
 */
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":398
 *             # on ajoute les atomes H qui manquent
 *             lst = [tok for tok in self if tok.symbol != "H"]
 *             for tok in lst:             # <<<<<<<<<<<<<<
 *                 existingH = len([bond.linkedto(tok) for bond in tok.cbonds if bond.linkedto(tok).symbol == "H"]) #ici
 *                 missingH = max(0, tok.valence - tok.grade - existingH)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":395
 *                 tok._hcount = 0
 *         # traitement 2 des hcount
 *         if fullH:             # <<<<<<<<<<<<<<
 *             # on ajoute les atomes H qui manquent
 *             lst = [tok for tok in self if tok.symbol != "H"]
 */
    goto __pyx_L8;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":414
 *         else:
 *             # on supprime les atomes H (ceux qui sont en [H] dans le smiles)
 *             lst = [tok for tok in self if tok.symbol == "H"]             # <<<<<<<<<<<<<<
 *             for tok in lst:
 *                 if tok.hcount and len(tok.cbonds):  #
 */
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L31_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_self)) {
        __pyx_t_10 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_10); __pyx_t_2 = 0;
        __pyx_t_3 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 414, __pyx_L31_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L31_error)
      }
      for (;;) {
        if (likely(!__pyx_t_3)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 414, __pyx_L31_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 414, __pyx_L31_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_3(__pyx_t_10);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 414, __pyx_L31_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_tok, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr11__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L31_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_H, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 414, __pyx_L31_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr11__pyx_v_tok))) __PYX_ERR(0, 414, __pyx_L31_error)
        }
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_tok); __pyx_9genexpr11__pyx_v_tok = 0;
      goto __pyx_L35_exit_scope;
      __pyx_L31_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_tok); __pyx_9genexpr11__pyx_v_tok = 0;
      goto __pyx_L1_error;
      __pyx_L35_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":415
 *             # on supprime les atomes H (ceux qui sont en [H] dans le smiles)
 *             lst = [tok for tok in self if tok.symbol == "H"]
 *             for tok in lst:             # <<<<<<<<<<<<<<
 *                 if tok.hcount and len(tok.cbonds):  #
 *                     holder = tok.cbonds[0].linkedto(tok)
 */
    __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
      #else
      __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":416
 *             lst = [tok for tok in self if tok.symbol == "H"]
 *             for tok in lst:
 *                 if tok.hcount and len(tok.cbonds):  #             # <<<<<<<<<<<<<<
 *                     holder = tok.cbonds[0].linkedto(tok)
 *                     holder._hcount += 1
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_hcount_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L39_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_7 = (__pyx_t_9 != 0);
      __pyx_t_8 = __pyx_t_7;
      __pyx_L39_bool_binop_done:;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":417
 *             for tok in lst:
 *                 if tok.hcount and len(tok.cbonds):  #
 *                     holder = tok.cbonds[0].linkedto(tok)             # <<<<<<<<<<<<<<
 *                     holder._hcount += 1
 *                     index = holder.cbonds.index(tok.cbonds[0])
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tok); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_5)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_tok};
            __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_10);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_tok};
            __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_10);
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_INCREF(__pyx_v_tok);
            __Pyx_GIVEREF(__pyx_v_tok);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_tok);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_holder, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":418
 *                 if tok.hcount and len(tok.cbonds):  #
 *                     holder = tok.cbonds[0].linkedto(tok)
 *                     holder._hcount += 1             # <<<<<<<<<<<<<<
 *                     index = holder.cbonds.index(tok.cbonds[0])
 *                     if holder.chiral:
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_holder, __pyx_n_s_hcount); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_holder, __pyx_n_s_hcount, __pyx_t_5) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":419
 *                     holder = tok.cbonds[0].linkedto(tok)
 *                     holder._hcount += 1
 *                     index = holder.cbonds.index(tok.cbonds[0])             # <<<<<<<<<<<<<<
 *                     if holder.chiral:
 *                         holder._absolutechiral = _12absolute(holder._absolutechiral, index % 2)
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_holder, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 419, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
            __pyx_t_6 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":420
 *                     holder._hcount += 1
 *                     index = holder.cbonds.index(tok.cbonds[0])
 *                     if holder.chiral:             # <<<<<<<<<<<<<<
 *                         holder._absolutechiral = _12absolute(holder._absolutechiral, index % 2)
 *                 self.remove(tok)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_holder, __pyx_n_s_chiral); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

          /* "metaphor/chem_gm/core/metamolecule.py":421
 *                     index = holder.cbonds.index(tok.cbonds[0])
 *                     if holder.chiral:
 *                         holder._absolutechiral = _12absolute(holder._absolutechiral, index % 2)             # <<<<<<<<<<<<<<
 *                 self.remove(tok)
 *             #for tok in lst:
 */
          __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_12absolute); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_holder, __pyx_n_s_absolutechiral); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_index, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = NULL;
          __pyx_t_14 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
              __pyx_t_14 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_12, __pyx_t_6};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_12, __pyx_t_6};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 421, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            if (__pyx_t_10) {
              __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); __pyx_t_10 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_6);
            __pyx_t_12 = 0;
            __pyx_t_6 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_holder, __pyx_n_s_absolutechiral, __pyx_t_5) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":420
 *                     holder._hcount += 1
 *                     index = holder.cbonds.index(tok.cbonds[0])
 *                     if holder.chiral:             # <<<<<<<<<<<<<<
 *                         holder._absolutechiral = _12absolute(holder._absolutechiral, index % 2)
 *                 self.remove(tok)
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":416
 *             lst = [tok for tok in self if tok.symbol == "H"]
 *             for tok in lst:
 *                 if tok.hcount and len(tok.cbonds):  #             # <<<<<<<<<<<<<<
 *                     holder = tok.cbonds[0].linkedto(tok)
 *                     holder._hcount += 1
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":422
 *                     if holder.chiral:
 *                         holder._absolutechiral = _12absolute(holder._absolutechiral, index % 2)
 *                 self.remove(tok)             # <<<<<<<<<<<<<<
 *             #for tok in lst:
 *                 #doremove = True
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_remove); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_15) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_tok); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_tok};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_tok};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15); __pyx_t_15 = NULL;
          __Pyx_INCREF(__pyx_v_tok);
          __Pyx_GIVEREF(__pyx_v_tok);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_tok);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":415
 *             # on supprime les atomes H (ceux qui sont en [H] dans le smiles)
 *             lst = [tok for tok in self if tok.symbol == "H"]
 *             for tok in lst:             # <<<<<<<<<<<<<<
 *                 if tok.hcount and len(tok.cbonds):  #
 *                     holder = tok.cbonds[0].linkedto(tok)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":426
 *                 #doremove = True
 *                 #self.remove(tok)
 *             if len(lst):             # <<<<<<<<<<<<<<
 *                 self.normalizeNumeros()
 * 
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 426, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_2 != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":427
 *                 #self.remove(tok)
 *             if len(lst):
 *                 self.normalizeNumeros()             # <<<<<<<<<<<<<<
 * 
 *         # traitement des iso
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_normalizeNumeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":426
 *                 #doremove = True
 *                 #self.remove(tok)
 *             if len(lst):             # <<<<<<<<<<<<<<
 *                 self.normalizeNumeros()
 * 
 */
    }
  }
  __pyx_L8:;

  /* "metaphor/chem_gm/core/metamolecule.py":430
 * 
 *         # traitement des iso
 *         if isoalgo == GC.ISOALGO_PAIR:             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 if tok.rawiso == 1:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ISOALGO_PAIR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_isoalgo, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "metaphor/chem_gm/core/metamolecule.py":431
 *         # traitement des iso
 *         if isoalgo == GC.ISOALGO_PAIR:
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 if tok.rawiso == 1:
 *                     tok._iso = 1
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
      __pyx_t_3 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_3)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_3(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 431, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":432
 *         if isoalgo == GC.ISOALGO_PAIR:
 *             for tok in self.__smitokens:
 *                 if tok.rawiso == 1:             # <<<<<<<<<<<<<<
 *                     tok._iso = 1
 *                 elif tok.rawiso == -1:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_rawiso); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":433
 *             for tok in self.__smitokens:
 *                 if tok.rawiso == 1:
 *                     tok._iso = 1             # <<<<<<<<<<<<<<
 *                 elif tok.rawiso == -1:
 *                     tok._iso = 2
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_iso, __pyx_int_1) < 0) __PYX_ERR(0, 433, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":432
 *         if isoalgo == GC.ISOALGO_PAIR:
 *             for tok in self.__smitokens:
 *                 if tok.rawiso == 1:             # <<<<<<<<<<<<<<
 *                     tok._iso = 1
 *                 elif tok.rawiso == -1:
 */
        goto __pyx_L46;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":434
 *                 if tok.rawiso == 1:
 *                     tok._iso = 1
 *                 elif tok.rawiso == -1:             # <<<<<<<<<<<<<<
 *                     tok._iso = 2
 *             return
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_rawiso); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_11, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":435
 *                     tok._iso = 1
 *                 elif tok.rawiso == -1:
 *                     tok._iso = 2             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_iso, __pyx_int_2) < 0) __PYX_ERR(0, 435, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":434
 *                 if tok.rawiso == 1:
 *                     tok._iso = 1
 *                 elif tok.rawiso == -1:             # <<<<<<<<<<<<<<
 *                     tok._iso = 2
 *             return
 */
      }
      __pyx_L46:;

      /* "metaphor/chem_gm/core/metamolecule.py":431
 *         # traitement des iso
 *         if isoalgo == GC.ISOALGO_PAIR:
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 if tok.rawiso == 1:
 *                     tok._iso = 1
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":436
 *                 elif tok.rawiso == -1:
 *                     tok._iso = 2
 *             return             # <<<<<<<<<<<<<<
 * 
 *         rawisolist = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":430
 * 
 *         # traitement des iso
 *         if isoalgo == GC.ISOALGO_PAIR:             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 if tok.rawiso == 1:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":438
 *             return
 * 
 *         rawisolist = []             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             if tok.rawiso:
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_rawisolist = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":439
 * 
 *         rawisolist = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.rawiso:
 *                 rawisolist.append(tok)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 439, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":440
 *         rawisolist = []
 *         for tok in self.__smitokens:
 *             if tok.rawiso:             # <<<<<<<<<<<<<<
 *                 rawisolist.append(tok)
 *         #assert not (len(rawisolist) % 4), "error in %s"% self.smiles
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_rawiso); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":441
 *         for tok in self.__smitokens:
 *             if tok.rawiso:
 *                 rawisolist.append(tok)             # <<<<<<<<<<<<<<
 *         #assert not (len(rawisolist) % 4), "error in %s"% self.smiles
 *         #n = len(rawisolist) / 4
 */
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_rawisolist, __pyx_v_tok); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 441, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":440
 *         rawisolist = []
 *         for tok in self.__smitokens:
 *             if tok.rawiso:             # <<<<<<<<<<<<<<
 *                 rawisolist.append(tok)
 *         #assert not (len(rawisolist) % 4), "error in %s"% self.smiles
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":439
 * 
 *         rawisolist = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.rawiso:
 *                 rawisolist.append(tok)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":444
 *         #assert not (len(rawisolist) % 4), "error in %s"% self.smiles
 *         #n = len(rawisolist) / 4
 *         rawisogroups = []     #[[] for _ in range(n)]             # <<<<<<<<<<<<<<
 *         #groupindex = 0
 *         while len(rawisolist):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rawisogroups = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":446
 *         rawisogroups = []     #[[] for _ in range(n)]
 *         #groupindex = 0
 *         while len(rawisolist):             # <<<<<<<<<<<<<<
 *             found = False
 *             tok = rawisolist.pop(0)
 */
  while (1) {
    __pyx_t_2 = PyList_GET_SIZE(__pyx_v_rawisolist); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 446, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_2 != 0);
    if (!__pyx_t_8) break;

    /* "metaphor/chem_gm/core/metamolecule.py":447
 *         #groupindex = 0
 *         while len(rawisolist):
 *             found = False             # <<<<<<<<<<<<<<
 *             tok = rawisolist.pop(0)
 *             for lst in rawisogroups:
 */
    __pyx_v_found = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":448
 *         while len(rawisolist):
 *             found = False
 *             tok = rawisolist.pop(0)             # <<<<<<<<<<<<<<
 *             for lst in rawisogroups:
 *                 if len(lst):  # and (len(lst) <= 4):
 */
    __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_rawisolist, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":449
 *             found = False
 *             tok = rawisolist.pop(0)
 *             for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:
 */
    __pyx_t_1 = __pyx_v_rawisogroups; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 449, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":450
 *             tok = rawisolist.pop(0)
 *             for lst in rawisogroups:
 *                 if len(lst):  # and (len(lst) <= 4):             # <<<<<<<<<<<<<<
 *                     for tok2 in lst:
 *                         if tok.hasbondto(tok2):
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 450, __pyx_L1_error)
      __pyx_t_8 = (__pyx_t_9 != 0);
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":451
 *             for lst in rawisogroups:
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:             # <<<<<<<<<<<<<<
 *                         if tok.hasbondto(tok2):
 *                             found = True
 */
        if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
          __pyx_t_5 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
          __pyx_t_3 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_3)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L1_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 451, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 451, __pyx_L1_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 451, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_3(__pyx_t_5);
            if (unlikely(!__pyx_t_11)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 451, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_v_tok2, __pyx_t_11);
          __pyx_t_11 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":452
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:
 *                         if tok.hasbondto(tok2):             # <<<<<<<<<<<<<<
 *                             found = True
 *                             lst.append(tok)
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_hasbondto); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          if (!__pyx_t_15) {
            __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_tok2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 452, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_6)) {
              PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_tok2};
              __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 452, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_GOTREF(__pyx_t_11);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
              PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_v_tok2};
              __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 452, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_GOTREF(__pyx_t_11);
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 452, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_15); __pyx_t_15 = NULL;
              __Pyx_INCREF(__pyx_v_tok2);
              __Pyx_GIVEREF(__pyx_v_tok2);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_tok2);
              __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 452, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_8) {

            /* "metaphor/chem_gm/core/metamolecule.py":453
 *                     for tok2 in lst:
 *                         if tok.hasbondto(tok2):
 *                             found = True             # <<<<<<<<<<<<<<
 *                             lst.append(tok)
 *                         if found: break
 */
            __pyx_v_found = 1;

            /* "metaphor/chem_gm/core/metamolecule.py":454
 *                         if tok.hasbondto(tok2):
 *                             found = True
 *                             lst.append(tok)             # <<<<<<<<<<<<<<
 *                         if found: break
 *             if not found:
 */
            __pyx_t_16 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_v_tok); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 454, __pyx_L1_error)

            /* "metaphor/chem_gm/core/metamolecule.py":452
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:
 *                         if tok.hasbondto(tok2):             # <<<<<<<<<<<<<<
 *                             found = True
 *                             lst.append(tok)
 */
          }

          /* "metaphor/chem_gm/core/metamolecule.py":455
 *                             found = True
 *                             lst.append(tok)
 *                         if found: break             # <<<<<<<<<<<<<<
 *             if not found:
 *                 rawisogroups.append([])
 */
          __pyx_t_8 = (__pyx_v_found != 0);
          if (__pyx_t_8) {
            goto __pyx_L56_break;
          }

          /* "metaphor/chem_gm/core/metamolecule.py":451
 *             for lst in rawisogroups:
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:             # <<<<<<<<<<<<<<
 *                         if tok.hasbondto(tok2):
 *                             found = True
 */
        }
        __pyx_L56_break:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":450
 *             tok = rawisolist.pop(0)
 *             for lst in rawisogroups:
 *                 if len(lst):  # and (len(lst) <= 4):             # <<<<<<<<<<<<<<
 *                     for tok2 in lst:
 *                         if tok.hasbondto(tok2):
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":449
 *             found = False
 *             tok = rawisolist.pop(0)
 *             for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *                 if len(lst):  # and (len(lst) <= 4):
 *                     for tok2 in lst:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":456
 *                             lst.append(tok)
 *                         if found: break
 *             if not found:             # <<<<<<<<<<<<<<
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:
 */
    __pyx_t_8 = ((!(__pyx_v_found != 0)) != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":457
 *                         if found: break
 *             if not found:
 *                 rawisogroups.append([])             # <<<<<<<<<<<<<<
 *                 for lst in rawisogroups:
 *                     if not len(lst):
 */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_rawisogroups, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":458
 *             if not found:
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *                     if not len(lst):
 *                         lst.append(tok)
 */
      __pyx_t_1 = __pyx_v_rawisogroups; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      for (;;) {
        if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 458, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":459
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:
 *                     if not len(lst):             # <<<<<<<<<<<<<<
 *                         lst.append(tok)
 *                         found = True
 */
        __pyx_t_9 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 459, __pyx_L1_error)
        __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
        if (__pyx_t_8) {

          /* "metaphor/chem_gm/core/metamolecule.py":460
 *                 for lst in rawisogroups:
 *                     if not len(lst):
 *                         lst.append(tok)             # <<<<<<<<<<<<<<
 *                         found = True
 *                     if found: break
 */
          __pyx_t_16 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_v_tok); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 460, __pyx_L1_error)

          /* "metaphor/chem_gm/core/metamolecule.py":461
 *                     if not len(lst):
 *                         lst.append(tok)
 *                         found = True             # <<<<<<<<<<<<<<
 *                     if found: break
 *         for lst in rawisogroups:
 */
          __pyx_v_found = 1;

          /* "metaphor/chem_gm/core/metamolecule.py":459
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:
 *                     if not len(lst):             # <<<<<<<<<<<<<<
 *                         lst.append(tok)
 *                         found = True
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":462
 *                         lst.append(tok)
 *                         found = True
 *                     if found: break             # <<<<<<<<<<<<<<
 *         for lst in rawisogroups:
 *             lsti = self.splitIsoGroup(lst)
 */
        __pyx_t_8 = (__pyx_v_found != 0);
        if (__pyx_t_8) {
          goto __pyx_L61_break;
        }

        /* "metaphor/chem_gm/core/metamolecule.py":458
 *             if not found:
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *                     if not len(lst):
 *                         lst.append(tok)
 */
      }
      __pyx_L61_break:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":456
 *                             lst.append(tok)
 *                         if found: break
 *             if not found:             # <<<<<<<<<<<<<<
 *                 rawisogroups.append([])
 *                 for lst in rawisogroups:
 */
    }
  }

  /* "metaphor/chem_gm/core/metamolecule.py":463
 *                         found = True
 *                     if found: break
 *         for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *             lsti = self.splitIsoGroup(lst)
 *             while len(lsti):
 */
  __pyx_t_1 = __pyx_v_rawisogroups; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":464
 *                     if found: break
 *         for lst in rawisogroups:
 *             lsti = self.splitIsoGroup(lst)             # <<<<<<<<<<<<<<
 *             while len(lsti):
 *                 rawisogroups.append(lsti)
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_splitIsoGroup); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_lst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_lst};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_lst};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_lst);
        __Pyx_GIVEREF(__pyx_v_lst);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_lst);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_lsti, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":465
 *         for lst in rawisogroups:
 *             lsti = self.splitIsoGroup(lst)
 *             while len(lsti):             # <<<<<<<<<<<<<<
 *                 rawisogroups.append(lsti)
 *                 lsti = self.splitIsoGroup(lst)
 */
    while (1) {
      __pyx_t_9 = PyObject_Length(__pyx_v_lsti); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 465, __pyx_L1_error)
      __pyx_t_8 = (__pyx_t_9 != 0);
      if (!__pyx_t_8) break;

      /* "metaphor/chem_gm/core/metamolecule.py":466
 *             lsti = self.splitIsoGroup(lst)
 *             while len(lsti):
 *                 rawisogroups.append(lsti)             # <<<<<<<<<<<<<<
 *                 lsti = self.splitIsoGroup(lst)
 *         for lst in rawisogroups:
 */
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_rawisogroups, __pyx_v_lsti); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 466, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":467
 *             while len(lsti):
 *                 rawisogroups.append(lsti)
 *                 lsti = self.splitIsoGroup(lst)             # <<<<<<<<<<<<<<
 *         for lst in rawisogroups:
 *             self.ReduceIsoGroup(lst)
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_splitIsoGroup); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_lst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_lst};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_lst};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_INCREF(__pyx_v_lst);
          __Pyx_GIVEREF(__pyx_v_lst);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_lst);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF_SET(__pyx_v_lsti, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":463
 *                         found = True
 *                     if found: break
 *         for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *             lsti = self.splitIsoGroup(lst)
 *             while len(lsti):
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":468
 *                 rawisogroups.append(lsti)
 *                 lsti = self.splitIsoGroup(lst)
 *         for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *             self.ReduceIsoGroup(lst)
 *             if len(lst) in [2, 3]:
 */
  __pyx_t_1 = __pyx_v_rawisogroups; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":469
 *                 lsti = self.splitIsoGroup(lst)
 *         for lst in rawisogroups:
 *             self.ReduceIsoGroup(lst)             # <<<<<<<<<<<<<<
 *             if len(lst) in [2, 3]:
 *                 isolatedindex = -1
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_ReduceIsoGroup); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_lst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_lst};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_lst};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 469, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_lst);
        __Pyx_GIVEREF(__pyx_v_lst);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_lst);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":470
 *         for lst in rawisogroups:
 *             self.ReduceIsoGroup(lst)
 *             if len(lst) in [2, 3]:             # <<<<<<<<<<<<<<
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 470, __pyx_L1_error)
    __pyx_t_7 = ((__pyx_t_9 == 2) != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L71_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_t_9 == 3) != 0);
    __pyx_t_8 = __pyx_t_7;
    __pyx_L71_bool_binop_done:;
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "metaphor/chem_gm/core/metamolecule.py":471
 *             self.ReduceIsoGroup(lst)
 *             if len(lst) in [2, 3]:
 *                 isolatedindex = -1             # <<<<<<<<<<<<<<
 *                 for ind, tok in enumerate(lst):
 *                     if tok.isolatediso:
 */
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_XDECREF_SET(__pyx_v_isolatedindex, __pyx_int_neg_1);

      /* "metaphor/chem_gm/core/metamolecule.py":472
 *             if len(lst) in [2, 3]:
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):             # <<<<<<<<<<<<<<
 *                     if tok.isolatediso:
 *                         isolatedindex = ind
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_5 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
        __pyx_t_11 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
        __pyx_t_3 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_3)) {
          if (likely(PyList_CheckExact(__pyx_t_11))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
            #else
            __pyx_t_12 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 472, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
            #else
            __pyx_t_12 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 472, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          }
        } else {
          __pyx_t_12 = __pyx_t_3(__pyx_t_11);
          if (unlikely(!__pyx_t_12)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 472, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_12);
        }
        __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_12);
        __pyx_t_12 = 0;
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_5);
        __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5);
        __pyx_t_5 = __pyx_t_12;
        __pyx_t_12 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":473
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):
 *                     if tok.isolatediso:             # <<<<<<<<<<<<<<
 *                         isolatedindex = ind
 *                         break
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_isolatediso); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 473, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__pyx_t_7) {

          /* "metaphor/chem_gm/core/metamolecule.py":474
 *                 for ind, tok in enumerate(lst):
 *                     if tok.isolatediso:
 *                         isolatedindex = ind             # <<<<<<<<<<<<<<
 *                         break
 *                 if isolatedindex >= 0:
 */
          __Pyx_INCREF(__pyx_v_ind);
          __Pyx_DECREF_SET(__pyx_v_isolatedindex, __pyx_v_ind);

          /* "metaphor/chem_gm/core/metamolecule.py":475
 *                     if tok.isolatediso:
 *                         isolatedindex = ind
 *                         break             # <<<<<<<<<<<<<<
 *                 if isolatedindex >= 0:
 *                     cur = lst[isolatedindex]
 */
          goto __pyx_L74_break;

          /* "metaphor/chem_gm/core/metamolecule.py":473
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):
 *                     if tok.isolatediso:             # <<<<<<<<<<<<<<
 *                         isolatedindex = ind
 *                         break
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":472
 *             if len(lst) in [2, 3]:
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):             # <<<<<<<<<<<<<<
 *                     if tok.isolatediso:
 *                         isolatedindex = ind
 */
      }
      __pyx_L74_break:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":476
 *                         isolatedindex = ind
 *                         break
 *                 if isolatedindex >= 0:             # <<<<<<<<<<<<<<
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_isolatedindex, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {

        /* "metaphor/chem_gm/core/metamolecule.py":477
 *                         break
 *                 if isolatedindex >= 0:
 *                     cur = lst[isolatedindex]             # <<<<<<<<<<<<<<
 *                     for tok in cur._bonds:
 *                         if not tok in lst:
 */
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_v_isolatedindex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_cur, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":478
 *                 if isolatedindex >= 0:
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:             # <<<<<<<<<<<<<<
 *                         if not tok in lst:
 *                             cur._rawiso = - cur._rawiso
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_bonds_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
          __pyx_t_3 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_3 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_3)) {
            if (likely(PyList_CheckExact(__pyx_t_11))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L1_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_3(__pyx_t_11);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 478, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":479
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:
 *                         if not tok in lst:             # <<<<<<<<<<<<<<
 *                             cur._rawiso = - cur._rawiso
 *                             tok._rawiso = cur._rawiso
 */
          __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_tok, __pyx_v_lst, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
          __pyx_t_8 = (__pyx_t_7 != 0);
          if (__pyx_t_8) {

            /* "metaphor/chem_gm/core/metamolecule.py":480
 *                     for tok in cur._bonds:
 *                         if not tok in lst:
 *                             cur._rawiso = - cur._rawiso             # <<<<<<<<<<<<<<
 *                             tok._rawiso = cur._rawiso
 *                         if isolatedindex == 0:
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_rawiso_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_cur, __pyx_n_s_rawiso_2, __pyx_t_12) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":481
 *                         if not tok in lst:
 *                             cur._rawiso = - cur._rawiso
 *                             tok._rawiso = cur._rawiso             # <<<<<<<<<<<<<<
 *                         if isolatedindex == 0:
 *                             lst.insert(0, tok)
 */
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_rawiso_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 481, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_rawiso_2, __pyx_t_12) < 0) __PYX_ERR(0, 481, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":479
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:
 *                         if not tok in lst:             # <<<<<<<<<<<<<<
 *                             cur._rawiso = - cur._rawiso
 *                             tok._rawiso = cur._rawiso
 */
          }

          /* "metaphor/chem_gm/core/metamolecule.py":482
 *                             cur._rawiso = - cur._rawiso
 *                             tok._rawiso = cur._rawiso
 *                         if isolatedindex == 0:             # <<<<<<<<<<<<<<
 *                             lst.insert(0, tok)
 *                         else:
 */
          __pyx_t_12 = __Pyx_PyInt_EqObjC(__pyx_v_isolatedindex, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 482, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 482, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_8) {

            /* "metaphor/chem_gm/core/metamolecule.py":483
 *                             tok._rawiso = cur._rawiso
 *                         if isolatedindex == 0:
 *                             lst.insert(0, tok)             # <<<<<<<<<<<<<<
 *                         else:
 *                             lst.append(tok)
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_insert); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = NULL;
            __pyx_t_14 = 0;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_6)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
                __pyx_t_14 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_int_0, __pyx_v_tok};
              __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 483, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_12);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_int_0, __pyx_v_tok};
              __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 483, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_12);
            } else
            #endif
            {
              __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 483, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_15);
              if (__pyx_t_6) {
                __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_6); __pyx_t_6 = NULL;
              }
              __Pyx_INCREF(__pyx_int_0);
              __Pyx_GIVEREF(__pyx_int_0);
              PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_int_0);
              __Pyx_INCREF(__pyx_v_tok);
              __Pyx_GIVEREF(__pyx_v_tok);
              PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_v_tok);
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 483, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":482
 *                             cur._rawiso = - cur._rawiso
 *                             tok._rawiso = cur._rawiso
 *                         if isolatedindex == 0:             # <<<<<<<<<<<<<<
 *                             lst.insert(0, tok)
 *                         else:
 */
            goto __pyx_L80;
          }

          /* "metaphor/chem_gm/core/metamolecule.py":485
 *                             lst.insert(0, tok)
 *                         else:
 *                             lst.append(tok)             # <<<<<<<<<<<<<<
 *             if len(lst) >= 4:
 *                 if lst[0].rawiso == lst[3].rawiso:
 */
          /*else*/ {
            __pyx_t_16 = __Pyx_PyObject_Append(__pyx_v_lst, __pyx_v_tok); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 485, __pyx_L1_error)
          }
          __pyx_L80:;

          /* "metaphor/chem_gm/core/metamolecule.py":478
 *                 if isolatedindex >= 0:
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:             # <<<<<<<<<<<<<<
 *                         if not tok in lst:
 *                             cur._rawiso = - cur._rawiso
 */
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":476
 *                         isolatedindex = ind
 *                         break
 *                 if isolatedindex >= 0:             # <<<<<<<<<<<<<<
 *                     cur = lst[isolatedindex]
 *                     for tok in cur._bonds:
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":470
 *         for lst in rawisogroups:
 *             self.ReduceIsoGroup(lst)
 *             if len(lst) in [2, 3]:             # <<<<<<<<<<<<<<
 *                 isolatedindex = -1
 *                 for ind, tok in enumerate(lst):
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":486
 *                         else:
 *                             lst.append(tok)
 *             if len(lst) >= 4:             # <<<<<<<<<<<<<<
 *                 if lst[0].rawiso == lst[3].rawiso:
 *                     iso = 1
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 486, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_9 >= 4) != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":487
 *                             lst.append(tok)
 *             if len(lst) >= 4:
 *                 if lst[0].rawiso == lst[3].rawiso:             # <<<<<<<<<<<<<<
 *                     iso = 1
 *                 else:
 */
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_rawiso); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_lst, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_rawiso); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":488
 *             if len(lst) >= 4:
 *                 if lst[0].rawiso == lst[3].rawiso:
 *                     iso = 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     iso = 2
 */
        __pyx_v_iso = 1;

        /* "metaphor/chem_gm/core/metamolecule.py":487
 *                             lst.append(tok)
 *             if len(lst) >= 4:
 *                 if lst[0].rawiso == lst[3].rawiso:             # <<<<<<<<<<<<<<
 *                     iso = 1
 *                 else:
 */
        goto __pyx_L82;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":490
 *                     iso = 1
 *                 else:
 *                     iso = 2             # <<<<<<<<<<<<<<
 *                 lst[0]._iso = iso
 *                 lst[3]._iso = iso
 */
      /*else*/ {
        __pyx_v_iso = 2;
      }
      __pyx_L82:;

      /* "metaphor/chem_gm/core/metamolecule.py":491
 *                 else:
 *                     iso = 2
 *                 lst[0]._iso = iso             # <<<<<<<<<<<<<<
 *                 lst[3]._iso = iso
 * 
 */
      __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_v_iso); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_iso, __pyx_t_11) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":492
 *                     iso = 2
 *                 lst[0]._iso = iso
 *                 lst[3]._iso = iso             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_iso); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_lst, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_n_s_iso, __pyx_t_5) < 0) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":486
 *                         else:
 *                             lst.append(tok)
 *             if len(lst) >= 4:             # <<<<<<<<<<<<<<
 *                 if lst[0].rawiso == lst[3].rawiso:
 *                     iso = 1
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":468
 *                 rawisogroups.append(lsti)
 *                 lsti = self.splitIsoGroup(lst)
 *         for lst in rawisogroups:             # <<<<<<<<<<<<<<
 *             self.ReduceIsoGroup(lst)
 *             if len(lst) in [2, 3]:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.postprocess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_existingH);
  __Pyx_XDECREF(__pyx_v_missingH);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_Htok);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_holder);
  __Pyx_XDECREF(__pyx_v_rawisolist);
  __Pyx_XDECREF(__pyx_v_rawisogroups);
  __Pyx_XDECREF(__pyx_v_tok2);
  __Pyx_XDECREF(__pyx_v_lsti);
  __Pyx_XDECREF(__pyx_v_isolatedindex);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_bond);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_tok);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":507
 * #         return weight
 * 
 *     def splitIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Splitting of concatenated iso groups.
 *         Example  "C/C(=N\OC(=O)NC)/SC"
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_21splitIsoGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_20splitIsoGroup[] = "Splitting of concatenated iso groups.\n        Example  \"C/C(=N\\OC(=O)NC)/SC\"\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_21splitIsoGroup = {"splitIsoGroup", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_21splitIsoGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_20splitIsoGroup};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_21splitIsoGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lst = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("splitIsoGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lst,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("splitIsoGroup", 1, 2, 2, 1); __PYX_ERR(0, 507, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "splitIsoGroup") < 0)) __PYX_ERR(0, 507, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_lst = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("splitIsoGroup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 507, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.splitIsoGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_20splitIsoGroup(__pyx_self, __pyx_v_self, __pyx_v_lst);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_20splitIsoGroup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_lst) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_dbllst = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_last = NULL;
  PyObject *__pyx_v_common = NULL;
  PyObject *__pyx_v_pair = 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)(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;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("splitIsoGroup", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":511
 *         Example  "C/C(=N\OC(=O)NC)/SC"
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         if len(lst) <= 4:
 *             return res
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":512
 *         """
 *         res = []
 *         if len(lst) <= 4:             # <<<<<<<<<<<<<<
 *             return res
 *         dbllst = []
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 <= 4) != 0);
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/metamolecule.py":513
 *         res = []
 *         if len(lst) <= 4:
 *             return res             # <<<<<<<<<<<<<<
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":512
 *         """
 *         res = []
 *         if len(lst) <= 4:             # <<<<<<<<<<<<<<
 *             return res
 *         dbllst = []
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":514
 *         if len(lst) <= 4:
 *             return res
 *         dbllst = []             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(lst[:-1]):
 *             if tok.hasbondto(lst[ind+1], 2):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dbllst = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":515
 *             return res
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):             # <<<<<<<<<<<<<<
 *             if tok.hasbondto(lst[ind+1], 2):
 *                 dbllst.append((ind, ind+1))
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_lst, 0, -1L, NULL, NULL, &__pyx_slice__12, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 515, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 515, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 515, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":516
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):
 *             if tok.hasbondto(lst[ind+1], 2):             # <<<<<<<<<<<<<<
 *                 dbllst.append((ind, ind+1))
 *         last = None
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_hasbondto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_ind, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_9, __pyx_int_2};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_9, __pyx_int_2};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_9);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_int_2);
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "metaphor/chem_gm/core/metamolecule.py":517
 *         for ind, tok in enumerate(lst[:-1]):
 *             if tok.hasbondto(lst[ind+1], 2):
 *                 dbllst.append((ind, ind+1))             # <<<<<<<<<<<<<<
 *         last = None
 *         common = None
 */
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ind, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_ind);
      __Pyx_GIVEREF(__pyx_v_ind);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ind);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_dbllst, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":516
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):
 *             if tok.hasbondto(lst[ind+1], 2):             # <<<<<<<<<<<<<<
 *                 dbllst.append((ind, ind+1))
 *         last = None
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":515
 *             return res
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):             # <<<<<<<<<<<<<<
 *             if tok.hasbondto(lst[ind+1], 2):
 *                 dbllst.append((ind, ind+1))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":518
 *             if tok.hasbondto(lst[ind+1], 2):
 *                 dbllst.append((ind, ind+1))
 *         last = None             # <<<<<<<<<<<<<<
 *         common = None
 *         for ind, pair in enumerate(dbllst):
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_last = Py_None;

  /* "metaphor/chem_gm/core/metamolecule.py":519
 *                 dbllst.append((ind, ind+1))
 *         last = None
 *         common = None             # <<<<<<<<<<<<<<
 *         for ind, pair in enumerate(dbllst):
 *             if not last:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_common = Py_None;

  /* "metaphor/chem_gm/core/metamolecule.py":520
 *         last = None
 *         common = None
 *         for ind, pair in enumerate(dbllst):             # <<<<<<<<<<<<<<
 *             if not last:
 *                 last = pair
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_5 = __pyx_v_dbllst; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 520, __pyx_L1_error)
    #else
    __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_pair, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":521
 *         common = None
 *         for ind, pair in enumerate(dbllst):
 *             if not last:             # <<<<<<<<<<<<<<
 *                 last = pair
 *             elif pair[0] == last[1] + 1:
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_last); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
    __pyx_t_13 = ((!__pyx_t_3) != 0);
    if (__pyx_t_13) {

      /* "metaphor/chem_gm/core/metamolecule.py":522
 *         for ind, pair in enumerate(dbllst):
 *             if not last:
 *                 last = pair             # <<<<<<<<<<<<<<
 *             elif pair[0] == last[1] + 1:
 *                 common = pair[0]
 */
      __Pyx_INCREF(__pyx_v_pair);
      __Pyx_DECREF_SET(__pyx_v_last, __pyx_v_pair);

      /* "metaphor/chem_gm/core/metamolecule.py":521
 *         common = None
 *         for ind, pair in enumerate(dbllst):
 *             if not last:             # <<<<<<<<<<<<<<
 *                 last = pair
 *             elif pair[0] == last[1] + 1:
 */
      goto __pyx_L9;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":523
 *             if not last:
 *                 last = pair
 *             elif pair[0] == last[1] + 1:             # <<<<<<<<<<<<<<
 *                 common = pair[0]
 *                 break;
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_pair, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_last, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_13) {

      /* "metaphor/chem_gm/core/metamolecule.py":524
 *                 last = pair
 *             elif pair[0] == last[1] + 1:
 *                 common = pair[0]             # <<<<<<<<<<<<<<
 *                 break;
 *             else:
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pair, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_common, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":525
 *             elif pair[0] == last[1] + 1:
 *                 common = pair[0]
 *                 break;             # <<<<<<<<<<<<<<
 *             else:
 *                 last = pair
 */
      goto __pyx_L8_break;

      /* "metaphor/chem_gm/core/metamolecule.py":523
 *             if not last:
 *                 last = pair
 *             elif pair[0] == last[1] + 1:             # <<<<<<<<<<<<<<
 *                 common = pair[0]
 *                 break;
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":527
 *                 break;
 *             else:
 *                 last = pair             # <<<<<<<<<<<<<<
 *         if common is not None:
 *             res = [lst[common-1], lst[common]]
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_pair);
      __Pyx_DECREF_SET(__pyx_v_last, __pyx_v_pair);
    }
    __pyx_L9:;

    /* "metaphor/chem_gm/core/metamolecule.py":520
 *         last = None
 *         common = None
 *         for ind, pair in enumerate(dbllst):             # <<<<<<<<<<<<<<
 *             if not last:
 *                 last = pair
 */
  }
  __pyx_L8_break:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":528
 *             else:
 *                 last = pair
 *         if common is not None:             # <<<<<<<<<<<<<<
 *             res = [lst[common-1], lst[common]]
 *             while len(lst) > common + 1:
 */
  __pyx_t_13 = (__pyx_v_common != Py_None);
  __pyx_t_3 = (__pyx_t_13 != 0);
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/metamolecule.py":529
 *                 last = pair
 *         if common is not None:
 *             res = [lst[common-1], lst[common]]             # <<<<<<<<<<<<<<
 *             while len(lst) > common + 1:
 *                 tok = lst.pop(ind + 1)
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_common, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_lst, __pyx_v_common); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_res, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":530
 *         if common is not None:
 *             res = [lst[common-1], lst[common]]
 *             while len(lst) > common + 1:             # <<<<<<<<<<<<<<
 *                 tok = lst.pop(ind + 1)
 *                 res.append(tok)
 */
    while (1) {
      __pyx_t_2 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 530, __pyx_L1_error)
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_common, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_3) break;

      /* "metaphor/chem_gm/core/metamolecule.py":531
 *             res = [lst[common-1], lst[common]]
 *             while len(lst) > common + 1:
 *                 tok = lst.pop(ind + 1)             # <<<<<<<<<<<<<<
 *                 res.append(tok)
 *         return res
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(!__pyx_v_ind)) { __Pyx_RaiseUnboundLocalError("ind"); __PYX_ERR(0, 531, __pyx_L1_error) }
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ind, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_4};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_4};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":532
 *             while len(lst) > common + 1:
 *                 tok = lst.pop(ind + 1)
 *                 res.append(tok)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_tok); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 532, __pyx_L1_error)
    }

    /* "metaphor/chem_gm/core/metamolecule.py":528
 *             else:
 *                 last = pair
 *         if common is not None:             # <<<<<<<<<<<<<<
 *             res = [lst[common-1], lst[common]]
 *             while len(lst) > common + 1:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":533
 *                 tok = lst.pop(ind + 1)
 *                 res.append(tok)
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def ReduceIsoGroup(self, lst):  # MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":507
 * #         return weight
 * 
 *     def splitIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Splitting of concatenated iso groups.
 *         Example  "C/C(=N\OC(=O)NC)/SC"
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.splitIsoGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_dbllst);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_last);
  __Pyx_XDECREF(__pyx_v_common);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":535
 *         return res
 * 
 *     def ReduceIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove of exceeding iso groups.
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_23ReduceIsoGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_22ReduceIsoGroup[] = "Remove of exceeding iso groups.\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_23ReduceIsoGroup = {"ReduceIsoGroup", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_23ReduceIsoGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_22ReduceIsoGroup};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_23ReduceIsoGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lst = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReduceIsoGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lst,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ReduceIsoGroup", 1, 2, 2, 1); __PYX_ERR(0, 535, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ReduceIsoGroup") < 0)) __PYX_ERR(0, 535, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_lst = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ReduceIsoGroup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.ReduceIsoGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_22ReduceIsoGroup(__pyx_self, __pyx_v_self, __pyx_v_lst);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_22ReduceIsoGroup(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_lst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("ReduceIsoGroup", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":538
 *         """Remove of exceeding iso groups.
 *         """
 *         if len(lst) > 4: # 5 ou 6             # <<<<<<<<<<<<<<
 *             if not lst[0].hasbondto(lst[1]):
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 538, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 4) != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":539
 *         """
 *         if len(lst) > 4: # 5 ou 6
 *             if not lst[0].hasbondto(lst[1]):             # <<<<<<<<<<<<<<
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):
 *                     lst.pop(1)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hasbondto); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = ((!__pyx_t_2) != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":540
 *         if len(lst) > 4: # 5 ou 6
 *             if not lst[0].hasbondto(lst[1]):
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):             # <<<<<<<<<<<<<<
 *                     lst.pop(1)
 *                 else:
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fragmentweight); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_lst, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __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_5, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_lst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fragmentweight); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_lst, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __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_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __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, 540, __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_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":541
 *             if not lst[0].hasbondto(lst[1]):
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):
 *                     lst.pop(1)             # <<<<<<<<<<<<<<
 *                 else:
 *                     lst.pop(0)
 */
        __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_lst, __pyx_int_1, 1, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":540
 *         if len(lst) > 4: # 5 ou 6
 *             if not lst[0].hasbondto(lst[1]):
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):             # <<<<<<<<<<<<<<
 *                     lst.pop(1)
 *                 else:
 */
        goto __pyx_L5;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":543
 *                     lst.pop(1)
 *                 else:
 *                     lst.pop(0)             # <<<<<<<<<<<<<<
 *             if not lst[-1].hasbondto(lst[-2]):
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_lst, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L5:;

      /* "metaphor/chem_gm/core/metamolecule.py":539
 *         """
 *         if len(lst) > 4: # 5 ou 6
 *             if not lst[0].hasbondto(lst[1]):             # <<<<<<<<<<<<<<
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):
 *                     lst.pop(1)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":544
 *                 else:
 *                     lst.pop(0)
 *             if not lst[-1].hasbondto(lst[-2]):             # <<<<<<<<<<<<<<
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):
 *                     lst.pop(len(lst) - 2)
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lst, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_hasbondto); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lst, -2L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = ((!__pyx_t_8) != 0);
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":545
 *                     lst.pop(0)
 *             if not lst[-1].hasbondto(lst[-2]):
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):             # <<<<<<<<<<<<<<
 *                     lst.pop(len(lst) - 2)
 *                 else:
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lst, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fragmentweight); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lst, -3L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __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 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __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, 545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_lst, -2L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_fragmentweight); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_lst, -3L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      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);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "metaphor/chem_gm/core/metamolecule.py":546
 *             if not lst[-1].hasbondto(lst[-2]):
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):
 *                     lst.pop(len(lst) - 2)             # <<<<<<<<<<<<<<
 *                 else:
 *                     lst.pop(len(lst) -1)
 */
        __pyx_t_1 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 546, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyObject_PopIndex(__pyx_v_lst, Py_None, (__pyx_t_1 - 2), 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":545
 *                     lst.pop(0)
 *             if not lst[-1].hasbondto(lst[-2]):
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):             # <<<<<<<<<<<<<<
 *                     lst.pop(len(lst) - 2)
 *                 else:
 */
        goto __pyx_L7;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":548
 *                     lst.pop(len(lst) - 2)
 *                 else:
 *                     lst.pop(len(lst) -1)             # <<<<<<<<<<<<<<
 * 
 *     def mass(self):  # MetaMolecule
 */
      /*else*/ {
        __pyx_t_1 = PyObject_Length(__pyx_v_lst); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyObject_PopIndex(__pyx_v_lst, Py_None, (__pyx_t_1 - 1), 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L7:;

      /* "metaphor/chem_gm/core/metamolecule.py":544
 *                 else:
 *                     lst.pop(0)
 *             if not lst[-1].hasbondto(lst[-2]):             # <<<<<<<<<<<<<<
 *                 if lst[-1].fragmentweight([lst[-3]]) > lst[-2].fragmentweight([lst[-3]]):
 *                     lst.pop(len(lst) - 2)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":538
 *         """Remove of exceeding iso groups.
 *         """
 *         if len(lst) > 4: # 5 ou 6             # <<<<<<<<<<<<<<
 *             if not lst[0].hasbondto(lst[1]):
 *                 if lst[0].fragmentweight([lst[2]]) > lst[1].fragmentweight([lst[2]]):
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":535
 *         return res
 * 
 *     def ReduceIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove of exceeding iso groups.
 *         """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.ReduceIsoGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":550
 *                     lst.pop(len(lst) -1)
 * 
 *     def mass(self):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Mass of the molecule
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_25mass(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_24mass[] = "Mass of the molecule\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_25mass = {"mass", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_25mass, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_24mass};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_25mass(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mass (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_24mass(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "metaphor/chem_gm/core/metamolecule.py":553
 *         """Mass of the molecule
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.__smitokens[0].fragmentweight([], True, True)
 *         except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/chem_gm/core/metamolecule.py":554
 *         """
 *         try:
 *             return self.__smitokens[0].fragmentweight([], True, True)             # <<<<<<<<<<<<<<
 *         except:
 *             return 0
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fragmentweight); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, Py_True, Py_True};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, Py_True, Py_True};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 554, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
        __Pyx_INCREF(Py_True);
        __Pyx_GIVEREF(Py_True);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, Py_True);
        __Pyx_INCREF(Py_True);
        __Pyx_GIVEREF(Py_True);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, Py_True);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "metaphor/chem_gm/core/metamolecule.py":553
 *         """Mass of the molecule
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.__smitokens[0].fragmentweight([], True, True)
 *         except:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":555
 *         try:
 *             return self.__smitokens[0].fragmentweight([], True, True)
 *         except:             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.mass", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 555, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_9);

      /* "metaphor/chem_gm/core/metamolecule.py":556
 *             return self.__smitokens[0].fragmentweight([], True, True)
 *         except:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     def printAll(self, *argv, **kwd):  # MetaMolecule
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_int_0);
      __pyx_r = __pyx_int_0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/chem_gm/core/metamolecule.py":553
 *         """Mass of the molecule
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.__smitokens[0].fragmentweight([], True, True)
 *         except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":550
 *                     lst.pop(len(lst) -1)
 * 
 *     def mass(self):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Mass of the molecule
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.mass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":558
 *             return 0
 * 
 *     def printAll(self, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Print all the tokens
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_27printAll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_26printAll[] = "Print all the tokens\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_27printAll = {"printAll", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_27printAll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_26printAll};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_27printAll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_argv = 0;
  PyObject *__pyx_v_kwd = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("printAll (wrapper)", 0);
  __pyx_v_kwd = PyDict_New(); if (unlikely(!__pyx_v_kwd)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwd);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_argv = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_argv)) {
      __Pyx_DECREF(__pyx_v_kwd); __pyx_v_kwd = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_argv);
  } else {
    __pyx_v_argv = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwd, values, used_pos_args, "printAll") < 0)) __PYX_ERR(0, 558, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("printAll", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_argv); __pyx_v_argv = 0;
  __Pyx_DECREF(__pyx_v_kwd); __pyx_v_kwd = 0;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.printAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_26printAll(__pyx_self, __pyx_v_self, __pyx_v_argv, __pyx_v_kwd);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_26printAll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_argv, PyObject *__pyx_v_kwd) {
  PyObject *__pyx_v_writer = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("printAll", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":561
 *         """Print all the tokens
 *         """
 *         if 'writer' in kwd:             # <<<<<<<<<<<<<<
 *             writer = kwd.pop('writer')
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_writer, __pyx_v_kwd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 561, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":562
 *         """
 *         if 'writer' in kwd:
 *             writer = kwd.pop('writer')             # <<<<<<<<<<<<<<
 *         else:
 *             writer = sys.stdout
 */
    __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_kwd, __pyx_n_u_writer, ((PyObject *)NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_writer = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":561
 *         """Print all the tokens
 *         """
 *         if 'writer' in kwd:             # <<<<<<<<<<<<<<
 *             writer = kwd.pop('writer')
 *         else:
 */
    goto __pyx_L3;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":564
 *             writer = kwd.pop('writer')
 *         else:
 *             writer = sys.stdout             # <<<<<<<<<<<<<<
 *         return self.write(writer, *argv, **kwd)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_writer = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "metaphor/chem_gm/core/metamolecule.py":565
 *         else:
 *             writer = sys.stdout
 *         return self.write(writer, *argv, **kwd)             # <<<<<<<<<<<<<<
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_writer);
  __Pyx_GIVEREF(__pyx_v_writer);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_writer);
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_argv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_v_kwd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":558
 *             return 0
 * 
 *     def printAll(self, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Print all the tokens
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.printAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_29write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_29write = {"write", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_29write, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_29write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ff = 0;
  PyObject *__pyx_v_argv = 0;
  PyObject *__pyx_v_kwd = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_v_kwd = PyDict_New(); if (unlikely(!__pyx_v_kwd)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwd);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_argv = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_argv)) {
      __Pyx_DECREF(__pyx_v_kwd); __pyx_v_kwd = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_argv);
  } else {
    __pyx_v_argv = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ff,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ff)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 0, 2, 2, 1); __PYX_ERR(0, 567, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwd, values, used_pos_args, "write") < 0)) __PYX_ERR(0, 567, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ff = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 567, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_argv); __pyx_v_argv = 0;
  __Pyx_DECREF(__pyx_v_kwd); __pyx_v_kwd = 0;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_28write(__pyx_self, __pyx_v_self, __pyx_v_ff, __pyx_v_argv, __pyx_v_kwd);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_argv);
  __Pyx_XDECREF(__pyx_v_kwd);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":583
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))             # <<<<<<<<<<<<<<
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))
 * #                     ff.write("\n")
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 583, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MetaMolecule_write_locals_genexp, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.write.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) { __Pyx_RaiseClosureNameError("atoms"); __PYX_ERR(0, 583, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 583, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 583, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 583, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_5generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":584
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))             # <<<<<<<<<<<<<<
 * #                     ff.write("\n")
 * 
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 584, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_5generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MetaMolecule_write_locals_genexp, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.write.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_5generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 584, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bonds)) { __Pyx_RaiseClosureNameError("bonds"); __PYX_ERR(0, 584, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bonds)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bonds)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bonds; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bonds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 584, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 584, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 584, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_28write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ff, PyObject *__pyx_v_argv, PyObject *__pyx_v_kwd) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *__pyx_cur_scope;
  PyObject *__pyx_v_docycles = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_bondss = NULL;
  PyObject *__pyx_v_atomss = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  __Pyx_RefNannySetupContext("write", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 567, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_argv);

  /* "metaphor/chem_gm/core/metamolecule.py":568
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule
 *         docycles = kwd.pop("cycles", False)             # <<<<<<<<<<<<<<
 *         if self.name:
 *             ff.write(self.name + "\n")
 */
  __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_kwd, __pyx_n_u_cycles, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_docycles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":569
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:             # <<<<<<<<<<<<<<
 *             ff.write(self.name + "\n")
 *         if self.smiles:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":570
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 *             ff.write(self.name + "\n")             # <<<<<<<<<<<<<<
 *         if self.smiles:
 *             ff.write(self.smiles + "\n")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __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_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":569
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:             # <<<<<<<<<<<<<<
 *             ff.write(self.name + "\n")
 *         if self.smiles:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":571
 *         if self.name:
 *             ff.write(self.name + "\n")
 *         if self.smiles:             # <<<<<<<<<<<<<<
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_smiles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":572
 *             ff.write(self.name + "\n")
 *         if self.smiles:
 *             ff.write(self.smiles + "\n")             # <<<<<<<<<<<<<<
 *         argv = argv if len(argv) else (None,)
 *         for tok in islice(self.__smitokens, *argv):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_smiles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":571
 *         if self.name:
 *             ff.write(self.name + "\n")
 *         if self.smiles:             # <<<<<<<<<<<<<<
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":573
 *         if self.smiles:
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)             # <<<<<<<<<<<<<<
 *         for tok in islice(self.__smitokens, *argv):
 *             ff.write(str(tok))
 */
  __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v_argv); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 573, __pyx_L1_error)
  if ((__pyx_t_7 != 0)) {
    __Pyx_INCREF(__pyx_v_argv);
    __pyx_t_1 = __pyx_v_argv;
  } else {
    __Pyx_INCREF(__pyx_tuple__13);
    __pyx_t_1 = __pyx_tuple__13;
  }
  __Pyx_DECREF_SET(__pyx_v_argv, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":574
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)
 *         for tok in islice(self.__smitokens, *argv):             # <<<<<<<<<<<<<<
 *             ff.write(str(tok))
 *             ff.write("\n")
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  if (unlikely(__pyx_v_argv == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 574, __pyx_L1_error)
  }
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_argv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 574, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 574, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 574, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":575
 *         argv = argv if len(argv) else (None,)
 *         for tok in islice(self.__smitokens, *argv):
 *             ff.write(str(tok))             # <<<<<<<<<<<<<<
 *             ff.write("\n")
 *         if docycles:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_tok); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __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_6, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __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, 575, __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_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":576
 *         for tok in islice(self.__smitokens, *argv):
 *             ff.write(str(tok))
 *             ff.write("\n")             # <<<<<<<<<<<<<<
 *         if docycles:
 *             bondss = self.cycles(asBond=True, ordered=True)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":574
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)
 *         for tok in islice(self.__smitokens, *argv):             # <<<<<<<<<<<<<<
 *             ff.write(str(tok))
 *             ff.write("\n")
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":577
 *             ff.write(str(tok))
 *             ff.write("\n")
 *         if docycles:             # <<<<<<<<<<<<<<
 *             bondss = self.cycles(asBond=True, ordered=True)
 *             atomss = self.cycles(asBond=False, ordered=True)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_docycles); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 577, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":578
 *             ff.write("\n")
 *         if docycles:
 *             bondss = self.cycles(asBond=True, ordered=True)             # <<<<<<<<<<<<<<
 *             atomss = self.cycles(asBond=False, ordered=True)
 *             if len(bondss):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_asBond, Py_True) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ordered, Py_True) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_bondss = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":579
 *         if docycles:
 *             bondss = self.cycles(asBond=True, ordered=True)
 *             atomss = self.cycles(asBond=False, ordered=True)             # <<<<<<<<<<<<<<
 *             if len(bondss):
 *                 ff.write("\nCycles :\n")
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_asBond, Py_False) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ordered, Py_True) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_atomss = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":580
 *             bondss = self.cycles(asBond=True, ordered=True)
 *             atomss = self.cycles(asBond=False, ordered=True)
 *             if len(bondss):             # <<<<<<<<<<<<<<
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):
 */
    __pyx_t_7 = PyObject_Length(__pyx_v_bondss); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 580, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 != 0);
    if (__pyx_t_2) {

      /* "metaphor/chem_gm/core/metamolecule.py":581
 *             atomss = self.cycles(asBond=False, ordered=True)
 *             if len(bondss):
 *                 ff.write("\nCycles :\n")             # <<<<<<<<<<<<<<
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __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/metamolecule.py":582
 *             if len(bondss):
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):             # <<<<<<<<<<<<<<
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))
 */
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_bondss);
      __Pyx_GIVEREF(__pyx_v_bondss);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bondss);
      __Pyx_INCREF(__pyx_v_atomss);
      __Pyx_GIVEREF(__pyx_v_atomss);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_atomss);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_8(__pyx_t_1);
          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, 582, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 582, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          #else
          __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext;
          index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 582, __pyx_L1_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_bonds);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_bonds, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_atoms);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_atoms, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":583
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))             # <<<<<<<<<<<<<<
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))
 * #                     ff.write("\n")
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__16, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __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_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":584
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))             # <<<<<<<<<<<<<<
 * #                     ff.write("\n")
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_ff, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5write_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__16, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __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_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_9)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          {
            __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":582
 *             if len(bondss):
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):             # <<<<<<<<<<<<<<
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in bonds))
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":580
 *             bondss = self.cycles(asBond=True, ordered=True)
 *             atomss = self.cycles(asBond=False, ordered=True)
 *             if len(bondss):             # <<<<<<<<<<<<<<
 *                 ff.write("\nCycles :\n")
 *                 for bonds, atoms in zip(bondss, atomss):
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":577
 *             ff.write(str(tok))
 *             ff.write("\n")
 *         if docycles:             # <<<<<<<<<<<<<<
 *             bondss = self.cycles(asBond=True, ordered=True)
 *             atomss = self.cycles(asBond=False, ordered=True)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_argv);
  __Pyx_XDECREF(__pyx_v_docycles);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_bondss);
  __Pyx_XDECREF(__pyx_v_atomss);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":587
 * #                     ff.write("\n")
 * 
 *     def getdiff(self, target):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 */

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

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_30getdiff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target) {
  PyObject *__pyx_v_tl = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_t1 = NULL;
  PyObject *__pyx_v_t2 = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_UCS4 __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("getdiff", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":588
 * 
 *     def getdiff(self, target):  # MetaMolecule
 *         tl = []             # <<<<<<<<<<<<<<
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 *             st = t1.getdiff(t2)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":589
 *     def getdiff(self, target):  # MetaMolecule
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):             # <<<<<<<<<<<<<<
 *             st = t1.getdiff(t2)
 *             if st:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_target);
  __Pyx_GIVEREF(__pyx_v_target);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_target);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 589, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 589, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__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, 589, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 589, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 589, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_t1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_t2, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":590
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 *             st = t1.getdiff(t2)             # <<<<<<<<<<<<<<
 *             if st:
 *                 st = "(%d) %s"%(ind, st)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_getdiff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_t2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_t2};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_t2};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_t2);
        __Pyx_GIVEREF(__pyx_v_t2);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_t2);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __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_XDECREF_SET(__pyx_v_st, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":591
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 *             st = t1.getdiff(t2)
 *             if st:             # <<<<<<<<<<<<<<
 *                 st = "(%d) %s"%(ind, st)
 *                 tl.append(st)
 */
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_st); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 591, __pyx_L1_error)
    if (__pyx_t_10) {

      /* "metaphor/chem_gm/core/metamolecule.py":592
 *             st = t1.getdiff(t2)
 *             if st:
 *                 st = "(%d) %s"%(ind, st)             # <<<<<<<<<<<<<<
 *                 tl.append(st)
 *         return "\n".join(tl)
 */
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = 0;
      __pyx_t_12 = 127;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_11 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__17);
      __pyx_t_7 = __Pyx_PyObject_Format(__pyx_v_ind, __pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12;
      __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__18);
      __pyx_t_11 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__18);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__18);
      __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_st), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12;
      __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_st, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":593
 *             if st:
 *                 st = "(%d) %s"%(ind, st)
 *                 tl.append(st)             # <<<<<<<<<<<<<<
 *         return "\n".join(tl)
 * 
 */
      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_tl, __pyx_v_st); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 593, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":591
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 *             st = t1.getdiff(t2)
 *             if st:             # <<<<<<<<<<<<<<
 *                 st = "(%d) %s"%(ind, st)
 *                 tl.append(st)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":589
 *     def getdiff(self, target):  # MetaMolecule
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):             # <<<<<<<<<<<<<<
 *             st = t1.getdiff(t2)
 *             if st:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":594
 *                 st = "(%d) %s"%(ind, st)
 *                 tl.append(st)
 *         return "\n".join(tl)             # <<<<<<<<<<<<<<
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_v_tl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":587
 * #                     ff.write("\n")
 * 
 *     def getdiff(self, target):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getdiff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tl);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_t1);
  __Pyx_XDECREF(__pyx_v_t2);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":596
 *         return "\n".join(tl)
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule             # <<<<<<<<<<<<<<
 *         atomlst = []
 *         atomoccur = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_33_analyseinitiale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_33_analyseinitiale = {"_analyseinitiale", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_33_analyseinitiale, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_33_analyseinitiale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_withoccurences = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_analyseinitiale (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_withoccurences,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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_withoccurences);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_analyseinitiale") < 0)) __PYX_ERR(0, 596, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_withoccurences = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_analyseinitiale", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 596, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule._analyseinitiale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_32_analyseinitiale(__pyx_self, __pyx_v_self, __pyx_v_withoccurences);

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

/* "metaphor/chem_gm/core/metamolecule.py":608
 *         cyclelist = []
 *         chargelist = []
 *         occurs = defaultdict(lambda: 0)             # <<<<<<<<<<<<<<
 *         #occurmols = defaultdict(lambda: 0)
 *         occurmols = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16_analyseinitiale_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16_analyseinitiale_lambda6 = {"lambda6", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16_analyseinitiale_lambda6, METH_NOARGS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16_analyseinitiale_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self);

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

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

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

/* "metaphor/chem_gm/core/metamolecule.py":596
 *         return "\n".join(tl)
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule             # <<<<<<<<<<<<<<
 *         atomlst = []
 *         atomoccur = []
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_32_analyseinitiale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_withoccurences) {
  PyObject *__pyx_v_atomlst = NULL;
  PyObject *__pyx_v_atomoccur = NULL;
  PyObject *__pyx_v_gradeoccur = NULL;
  PyObject *__pyx_v_isooccur = NULL;
  PyObject *__pyx_v_chiraloccur = NULL;
  PyObject *__pyx_v_isomax = NULL;
  PyObject *__pyx_v_chiralmax = NULL;
  PyObject *__pyx_v_grade = NULL;
  PyObject *__pyx_v_cyclelist = NULL;
  PyObject *__pyx_v_chargelist = NULL;
  PyObject *__pyx_v_occurs = NULL;
  PyObject *__pyx_v_occurmols = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_charge = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_key = NULL;
  Py_ssize_t __pyx_v_cycles;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("_analyseinitiale", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":597
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule
 *         atomlst = []             # <<<<<<<<<<<<<<
 *         atomoccur = []
 *         gradeoccur = [0]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_atomlst = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":598
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule
 *         atomlst = []
 *         atomoccur = []             # <<<<<<<<<<<<<<
 *         gradeoccur = [0]
 *         isooccur = [0,0]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_atomoccur = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":599
 *         atomlst = []
 *         atomoccur = []
 *         gradeoccur = [0]             # <<<<<<<<<<<<<<
 *         isooccur = [0,0]
 *         chiraloccur = [0,0]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __pyx_v_gradeoccur = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":600
 *         atomoccur = []
 *         gradeoccur = [0]
 *         isooccur = [0,0]             # <<<<<<<<<<<<<<
 *         chiraloccur = [0,0]
 *         isomax = 0
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __pyx_v_isooccur = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":601
 *         gradeoccur = [0]
 *         isooccur = [0,0]
 *         chiraloccur = [0,0]             # <<<<<<<<<<<<<<
 *         isomax = 0
 *         chiralmax = 0
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __pyx_v_chiraloccur = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":602
 *         isooccur = [0,0]
 *         chiraloccur = [0,0]
 *         isomax = 0             # <<<<<<<<<<<<<<
 *         chiralmax = 0
 *         grade = 0
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_isomax = __pyx_int_0;

  /* "metaphor/chem_gm/core/metamolecule.py":603
 *         chiraloccur = [0,0]
 *         isomax = 0
 *         chiralmax = 0             # <<<<<<<<<<<<<<
 *         grade = 0
 *         #cycles = 0
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_chiralmax = __pyx_int_0;

  /* "metaphor/chem_gm/core/metamolecule.py":604
 *         isomax = 0
 *         chiralmax = 0
 *         grade = 0             # <<<<<<<<<<<<<<
 *         #cycles = 0
 *         cyclelist = []
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_grade = __pyx_int_0;

  /* "metaphor/chem_gm/core/metamolecule.py":606
 *         grade = 0
 *         #cycles = 0
 *         cyclelist = []             # <<<<<<<<<<<<<<
 *         chargelist = []
 *         occurs = defaultdict(lambda: 0)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cyclelist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":607
 *         #cycles = 0
 *         cyclelist = []
 *         chargelist = []             # <<<<<<<<<<<<<<
 *         occurs = defaultdict(lambda: 0)
 *         #occurmols = defaultdict(lambda: 0)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chargelist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":608
 *         cyclelist = []
 *         chargelist = []
 *         occurs = defaultdict(lambda: 0)             # <<<<<<<<<<<<<<
 *         #occurmols = defaultdict(lambda: 0)
 *         occurmols = []
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_16_analyseinitiale_lambda6, 0, __pyx_n_s_MetaMolecule__analyseinitiale_lo, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_occurs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":610
 *         occurs = defaultdict(lambda: 0)
 *         #occurmols = defaultdict(lambda: 0)
 *         occurmols = []             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             if tok.charge:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_occurmols = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":611
 *         #occurmols = defaultdict(lambda: 0)
 *         occurmols = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.charge:
 *                 charge = chargekey(tok.charge)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_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, 611, __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, 611, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 611, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":612
 *         occurmols = []
 *         for tok in self.__smitokens:
 *             if tok.charge:             # <<<<<<<<<<<<<<
 *                 charge = chargekey(tok.charge)
 *                 if not charge in chargelist:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_charge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":613
 *         for tok in self.__smitokens:
 *             if tok.charge:
 *                 charge = chargekey(tok.charge)             # <<<<<<<<<<<<<<
 *                 if not charge in chargelist:
 *                     chargelist.append(charge)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_chargekey); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_charge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __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_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 613, __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_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_charge, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":614
 *             if tok.charge:
 *                 charge = chargekey(tok.charge)
 *                 if not charge in chargelist:             # <<<<<<<<<<<<<<
 *                     chargelist.append(charge)
 *                 occurs[charge] += 1
 */
      __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_charge, __pyx_v_chargelist, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
      __pyx_t_10 = (__pyx_t_8 != 0);
      if (__pyx_t_10) {

        /* "metaphor/chem_gm/core/metamolecule.py":615
 *                 charge = chargekey(tok.charge)
 *                 if not charge in chargelist:
 *                     chargelist.append(charge)             # <<<<<<<<<<<<<<
 *                 occurs[charge] += 1
 *                 if not charge in occurmols:
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_chargelist, __pyx_v_charge); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 615, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":614
 *             if tok.charge:
 *                 charge = chargekey(tok.charge)
 *                 if not charge in chargelist:             # <<<<<<<<<<<<<<
 *                     chargelist.append(charge)
 *                 occurs[charge] += 1
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":616
 *                 if not charge in chargelist:
 *                     chargelist.append(charge)
 *                 occurs[charge] += 1             # <<<<<<<<<<<<<<
 *                 if not charge in occurmols:
 *                     occurmols.append(charge)
 */
      __Pyx_INCREF(__pyx_v_charge);
      __pyx_t_1 = __pyx_v_charge;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_1, __pyx_t_9) < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":617
 *                     chargelist.append(charge)
 *                 occurs[charge] += 1
 *                 if not charge in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(charge)
 *                 #tok.grade += abs(tok.charge)
 */
      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_charge, __pyx_v_occurmols, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
      __pyx_t_8 = (__pyx_t_10 != 0);
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":618
 *                 occurs[charge] += 1
 *                 if not charge in occurmols:
 *                     occurmols.append(charge)             # <<<<<<<<<<<<<<
 *                 #tok.grade += abs(tok.charge)
 *             for bond in tok.cbonds:
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_occurmols, __pyx_v_charge); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 618, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":617
 *                     chargelist.append(charge)
 *                 occurs[charge] += 1
 *                 if not charge in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(charge)
 *                 #tok.grade += abs(tok.charge)
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":612
 *         occurmols = []
 *         for tok in self.__smitokens:
 *             if tok.charge:             # <<<<<<<<<<<<<<
 *                 charge = chargekey(tok.charge)
 *                 if not charge in chargelist:
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":620
 *                     occurmols.append(charge)
 *                 #tok.grade += abs(tok.charge)
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if bond.broken and not bond in cyclelist:
 *                 #ici c'est bien broken qu'il faut mettre et pas modelbroken
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 620, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_13(__pyx_t_9);
        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, 620, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":621
 *                 #tok.grade += abs(tok.charge)
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in cyclelist:             # <<<<<<<<<<<<<<
 *                 #ici c'est bien broken qu'il faut mettre et pas modelbroken
 *                 # qui n'est pas encore renseign
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_broken); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 621, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_bond, __pyx_v_cyclelist, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 621, __pyx_L1_error)
      __pyx_t_14 = (__pyx_t_10 != 0);
      __pyx_t_8 = __pyx_t_14;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":624
 *                 #ici c'est bien broken qu'il faut mettre et pas modelbroken
 *                 # qui n'est pas encore renseign
 *                     cyclelist.append(bond)             # <<<<<<<<<<<<<<
 *             #cycles += len([bond for bond in tok.cbonds if bond.broken])
 *             #cycles += len(tok._b rokenbondindex)
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_cyclelist, __pyx_v_bond); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 624, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":621
 *                 #tok.grade += abs(tok.charge)
 *             for bond in tok.cbonds:
 *                 if bond.broken and not bond in cyclelist:             # <<<<<<<<<<<<<<
 *                 #ici c'est bien broken qu'il faut mettre et pas modelbroken
 *                 # qui n'est pas encore renseign
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":620
 *                     occurmols.append(charge)
 *                 #tok.grade += abs(tok.charge)
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if bond.broken and not bond in cyclelist:
 *                 #ici c'est bien broken qu'il faut mettre et pas modelbroken
 */
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":627
 *             #cycles += len([bond for bond in tok.cbonds if bond.broken])
 *             #cycles += len(tok._b rokenbondindex)
 *             i = findinlist(atomlst, tok.symbol)             # <<<<<<<<<<<<<<
 *             if i < 0:
 *                 atomlst.append(tok.symbol)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_findinlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    __pyx_t_15 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_15 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_atomlst, __pyx_t_5};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __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[3] = {__pyx_t_3, __pyx_v_atomlst, __pyx_t_5};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_atomlst);
      __Pyx_GIVEREF(__pyx_v_atomlst);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_15, __pyx_v_atomlst);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_15, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":628
 *             #cycles += len(tok._b rokenbondindex)
 *             i = findinlist(atomlst, tok.symbol)
 *             if i < 0:             # <<<<<<<<<<<<<<
 *                 atomlst.append(tok.symbol)
 *                 atomoccur.append(1)
 */
    __pyx_t_9 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":629
 *             i = findinlist(atomlst, tok.symbol)
 *             if i < 0:
 *                 atomlst.append(tok.symbol)             # <<<<<<<<<<<<<<
 *                 atomoccur.append(1)
 *             else:
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_atomlst, __pyx_t_9); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":630
 *             if i < 0:
 *                 atomlst.append(tok.symbol)
 *                 atomoccur.append(1)             # <<<<<<<<<<<<<<
 *             else:
 *                 atomoccur[i] += 1
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_atomoccur, __pyx_int_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 630, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":628
 *             #cycles += len(tok._b rokenbondindex)
 *             i = findinlist(atomlst, tok.symbol)
 *             if i < 0:             # <<<<<<<<<<<<<<
 *                 atomlst.append(tok.symbol)
 *                 atomoccur.append(1)
 */
      goto __pyx_L13;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":632
 *                 atomoccur.append(1)
 *             else:
 *                 atomoccur[i] += 1             # <<<<<<<<<<<<<<
 *             occurs[tok.symbol] += 1
 *             if not tok.symbol in occurmols:
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_i);
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_atomoccur, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_atomoccur, __pyx_t_9, __pyx_t_4) < 0)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_L13:;

    /* "metaphor/chem_gm/core/metamolecule.py":633
 *             else:
 *                 atomoccur[i] += 1
 *             occurs[tok.symbol] += 1             # <<<<<<<<<<<<<<
 *             if not tok.symbol in occurmols:
 *                 occurmols.append(tok.symbol)
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_9, __pyx_t_1) < 0)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":634
 *                 atomoccur[i] += 1
 *             occurs[tok.symbol] += 1
 *             if not tok.symbol in occurmols:             # <<<<<<<<<<<<<<
 *                 occurmols.append(tok.symbol)
 *             assert tok.grade >= 0
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v_occurmols, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_14 = (__pyx_t_8 != 0);
    if (__pyx_t_14) {

      /* "metaphor/chem_gm/core/metamolecule.py":635
 *             occurs[tok.symbol] += 1
 *             if not tok.symbol in occurmols:
 *                 occurmols.append(tok.symbol)             # <<<<<<<<<<<<<<
 *             assert tok.grade >= 0
 *             while len(gradeoccur) < tok.grade:
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_occurmols, __pyx_t_9); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":634
 *                 atomoccur[i] += 1
 *             occurs[tok.symbol] += 1
 *             if not tok.symbol in occurmols:             # <<<<<<<<<<<<<<
 *                 occurmols.append(tok.symbol)
 *             assert tok.grade >= 0
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":636
 *             if not tok.symbol in occurmols:
 *                 occurmols.append(tok.symbol)
 *             assert tok.grade >= 0             # <<<<<<<<<<<<<<
 *             while len(gradeoccur) < tok.grade:
 *                 gradeoccur.append(0)
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_14)) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 636, __pyx_L1_error)
      }
    }
    #endif

    /* "metaphor/chem_gm/core/metamolecule.py":637
 *                 occurmols.append(tok.symbol)
 *             assert tok.grade >= 0
 *             while len(gradeoccur) < tok.grade:             # <<<<<<<<<<<<<<
 *                 gradeoccur.append(0)
 *             gradeoccur[tok.grade-1] += 1
 */
    while (1) {
      __pyx_t_12 = PyList_GET_SIZE(__pyx_v_gradeoccur); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 637, __pyx_L1_error)
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_14) break;

      /* "metaphor/chem_gm/core/metamolecule.py":638
 *             assert tok.grade >= 0
 *             while len(gradeoccur) < tok.grade:
 *                 gradeoccur.append(0)             # <<<<<<<<<<<<<<
 *             gradeoccur[tok.grade-1] += 1
 *             key = gradekey(tok.grade)
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_gradeoccur, __pyx_int_0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error)
    }

    /* "metaphor/chem_gm/core/metamolecule.py":639
 *             while len(gradeoccur) < tok.grade:
 *                 gradeoccur.append(0)
 *             gradeoccur[tok.grade-1] += 1             # <<<<<<<<<<<<<<
 *             key = gradekey(tok.grade)
 *             occurs[key] += 1
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_gradeoccur, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_gradeoccur, __pyx_t_9, __pyx_t_1) < 0)) __PYX_ERR(0, 639, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":640
 *                 gradeoccur.append(0)
 *             gradeoccur[tok.grade-1] += 1
 *             key = gradekey(tok.grade)             # <<<<<<<<<<<<<<
 *             occurs[key] += 1
 *             if not key in occurmols:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gradekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_9);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":641
 *             gradeoccur[tok.grade-1] += 1
 *             key = gradekey(tok.grade)
 *             occurs[key] += 1             # <<<<<<<<<<<<<<
 *             if not key in occurmols:
 *                 occurmols.append(key)
 */
    __Pyx_INCREF(__pyx_v_key);
    __pyx_t_9 = __pyx_v_key;
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_9, __pyx_t_3) < 0)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":642
 *             key = gradekey(tok.grade)
 *             occurs[key] += 1
 *             if not key in occurmols:             # <<<<<<<<<<<<<<
 *                 occurmols.append(key)
 *             grade = max(grade, tok.grade)
 */
    __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_occurmols, Py_NE)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_14 != 0);
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":643
 *             occurs[key] += 1
 *             if not key in occurmols:
 *                 occurmols.append(key)             # <<<<<<<<<<<<<<
 *             grade = max(grade, tok.grade)
 *             if tok.iso:
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_occurmols, __pyx_v_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 643, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":642
 *             key = gradekey(tok.grade)
 *             occurs[key] += 1
 *             if not key in occurmols:             # <<<<<<<<<<<<<<
 *                 occurmols.append(key)
 *             grade = max(grade, tok.grade)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":644
 *             if not key in occurmols:
 *                 occurmols.append(key)
 *             grade = max(grade, tok.grade)             # <<<<<<<<<<<<<<
 *             if tok.iso:
 *                 isooccur[tok.iso-1] += 1
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_grade); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_grade);
    __pyx_t_3 = __pyx_v_grade;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_1 = __pyx_t_9;
    } else {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_grade, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":645
 *                 occurmols.append(key)
 *             grade = max(grade, tok.grade)
 *             if tok.iso:             # <<<<<<<<<<<<<<
 *                 isooccur[tok.iso-1] += 1
 *                 key = isokey(tok.iso)
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_iso_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":646
 *             grade = max(grade, tok.grade)
 *             if tok.iso:
 *                 isooccur[tok.iso-1] += 1             # <<<<<<<<<<<<<<
 *                 key = isokey(tok.iso)
 *                 occurs[key] += 1
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_iso_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_isooccur, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_isooccur, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":647
 *             if tok.iso:
 *                 isooccur[tok.iso-1] += 1
 *                 key = isokey(tok.iso)             # <<<<<<<<<<<<<<
 *                 occurs[key] += 1
 *                 if not key in occurmols:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_isokey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_iso_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 647, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":648
 *                 isooccur[tok.iso-1] += 1
 *                 key = isokey(tok.iso)
 *                 occurs[key] += 1             # <<<<<<<<<<<<<<
 *                 if not key in occurmols:
 *                     occurmols.append(key)
 */
      __Pyx_INCREF(__pyx_v_key);
      __pyx_t_1 = __pyx_v_key;
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_1, __pyx_t_5) < 0)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":649
 *                 key = isokey(tok.iso)
 *                 occurs[key] += 1
 *                 if not key in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(key)
 *                 isomax = max(isomax, tok.iso)
 */
      __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_occurmols, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 649, __pyx_L1_error)
      __pyx_t_14 = (__pyx_t_8 != 0);
      if (__pyx_t_14) {

        /* "metaphor/chem_gm/core/metamolecule.py":650
 *                 occurs[key] += 1
 *                 if not key in occurmols:
 *                     occurmols.append(key)             # <<<<<<<<<<<<<<
 *                 isomax = max(isomax, tok.iso)
 *             if tok.chiral:
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_occurmols, __pyx_v_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 650, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":649
 *                 key = isokey(tok.iso)
 *                 occurs[key] += 1
 *                 if not key in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(key)
 *                 isomax = max(isomax, tok.iso)
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":651
 *                 if not key in occurmols:
 *                     occurmols.append(key)
 *                 isomax = max(isomax, tok.iso)             # <<<<<<<<<<<<<<
 *             if tok.chiral:
 *                 chiraloccur[tok.chiral-1] += 1
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_iso_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_isomax);
      __pyx_t_5 = __pyx_v_isomax;
      __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_14) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1;
      } else {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_3 = __pyx_t_5;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_isomax, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":645
 *                 occurmols.append(key)
 *             grade = max(grade, tok.grade)
 *             if tok.iso:             # <<<<<<<<<<<<<<
 *                 isooccur[tok.iso-1] += 1
 *                 key = isokey(tok.iso)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":652
 *                     occurmols.append(key)
 *                 isomax = max(isomax, tok.iso)
 *             if tok.chiral:             # <<<<<<<<<<<<<<
 *                 chiraloccur[tok.chiral-1] += 1
 *                 key = chikey(tok.chiral)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_14) {

      /* "metaphor/chem_gm/core/metamolecule.py":653
 *                 isomax = max(isomax, tok.iso)
 *             if tok.chiral:
 *                 chiraloccur[tok.chiral-1] += 1             # <<<<<<<<<<<<<<
 *                 key = chikey(tok.chiral)
 *                 occurs[key] += 1
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_chiraloccur, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_chiraloccur, __pyx_t_3, __pyx_t_5) < 0)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":654
 *             if tok.chiral:
 *                 chiraloccur[tok.chiral-1] += 1
 *                 key = chikey(tok.chiral)             # <<<<<<<<<<<<<<
 *                 occurs[key] += 1
 *                 if not key in occurmols:
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_chikey); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_1};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __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, 654, __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_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":655
 *                 chiraloccur[tok.chiral-1] += 1
 *                 key = chikey(tok.chiral)
 *                 occurs[key] += 1             # <<<<<<<<<<<<<<
 *                 if not key in occurmols:
 *                     occurmols.append(key)
 */
      __Pyx_INCREF(__pyx_v_key);
      __pyx_t_3 = __pyx_v_key;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":656
 *                 key = chikey(tok.chiral)
 *                 occurs[key] += 1
 *                 if not key in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(key)
 *                 chiralmax = max(chiralmax, tok.chiral)
 */
      __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_occurmols, Py_NE)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
      __pyx_t_8 = (__pyx_t_14 != 0);
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":657
 *                 occurs[key] += 1
 *                 if not key in occurmols:
 *                     occurmols.append(key)             # <<<<<<<<<<<<<<
 *                 chiralmax = max(chiralmax, tok.chiral)
 *         cycles = len(cyclelist)
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_occurmols, __pyx_v_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 657, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":656
 *                 key = chikey(tok.chiral)
 *                 occurs[key] += 1
 *                 if not key in occurmols:             # <<<<<<<<<<<<<<
 *                     occurmols.append(key)
 *                 chiralmax = max(chiralmax, tok.chiral)
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":658
 *                 if not key in occurmols:
 *                     occurmols.append(key)
 *                 chiralmax = max(chiralmax, tok.chiral)             # <<<<<<<<<<<<<<
 *         cycles = len(cyclelist)
 *         if withoccurences:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_chiral); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_chiralmax);
      __pyx_t_4 = __pyx_v_chiralmax;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 658, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_8) {
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = __pyx_t_3;
      } else {
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = __pyx_t_4;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_t_5;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_chiralmax, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":652
 *                     occurmols.append(key)
 *                 isomax = max(isomax, tok.iso)
 *             if tok.chiral:             # <<<<<<<<<<<<<<
 *                 chiraloccur[tok.chiral-1] += 1
 *                 key = chikey(tok.chiral)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":611
 *         #occurmols = defaultdict(lambda: 0)
 *         occurmols = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.charge:
 *                 charge = chargekey(tok.charge)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":659
 *                     occurmols.append(key)
 *                 chiralmax = max(chiralmax, tok.chiral)
 *         cycles = len(cyclelist)             # <<<<<<<<<<<<<<
 *         if withoccurences:
 *             assert sum(atomoccur)==sum(gradeoccur)
 */
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_cyclelist); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 659, __pyx_L1_error)
  __pyx_v_cycles = __pyx_t_6;

  /* "metaphor/chem_gm/core/metamolecule.py":660
 *                 chiralmax = max(chiralmax, tok.chiral)
 *         cycles = len(cyclelist)
 *         if withoccurences:             # <<<<<<<<<<<<<<
 *             assert sum(atomoccur)==sum(gradeoccur)
 *             #return (atomlst, atomoccur), (grade, gradeoccur), (isomax, isooccur), (chiralmax, chiraloccur)
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_withoccurences); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "metaphor/chem_gm/core/metamolecule.py":661
 *         cycles = len(cyclelist)
 *         if withoccurences:
 *             assert sum(atomoccur)==sum(gradeoccur)             # <<<<<<<<<<<<<<
 *             #return (atomlst, atomoccur), (grade, gradeoccur), (isomax, isooccur), (chiralmax, chiraloccur)
 *             return atomlst, grade, isomax, chiralmax, occurs, occurmols, cycles, chargelist
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_atomoccur); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_gradeoccur); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 661, __pyx_L1_error)
      }
    }
    #endif

    /* "metaphor/chem_gm/core/metamolecule.py":663
 *             assert sum(atomoccur)==sum(gradeoccur)
 *             #return (atomlst, atomoccur), (grade, gradeoccur), (isomax, isooccur), (chiralmax, chiraloccur)
 *             return atomlst, grade, isomax, chiralmax, occurs, occurmols, cycles, chargelist             # <<<<<<<<<<<<<<
 *         return atomlst, grade, isomax, chiralmax, cycles, chargelist
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_cycles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_atomlst);
    __Pyx_GIVEREF(__pyx_v_atomlst);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_atomlst);
    __Pyx_INCREF(__pyx_v_grade);
    __Pyx_GIVEREF(__pyx_v_grade);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_grade);
    __Pyx_INCREF(__pyx_v_isomax);
    __Pyx_GIVEREF(__pyx_v_isomax);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_isomax);
    __Pyx_INCREF(__pyx_v_chiralmax);
    __Pyx_GIVEREF(__pyx_v_chiralmax);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_chiralmax);
    __Pyx_INCREF(__pyx_v_occurs);
    __Pyx_GIVEREF(__pyx_v_occurs);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_occurs);
    __Pyx_INCREF(__pyx_v_occurmols);
    __Pyx_GIVEREF(__pyx_v_occurmols);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_occurmols);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_chargelist);
    __Pyx_GIVEREF(__pyx_v_chargelist);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_chargelist);
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":660
 *                 chiralmax = max(chiralmax, tok.chiral)
 *         cycles = len(cyclelist)
 *         if withoccurences:             # <<<<<<<<<<<<<<
 *             assert sum(atomoccur)==sum(gradeoccur)
 *             #return (atomlst, atomoccur), (grade, gradeoccur), (isomax, isooccur), (chiralmax, chiraloccur)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":664
 *             #return (atomlst, atomoccur), (grade, gradeoccur), (isomax, isooccur), (chiralmax, chiraloccur)
 *             return atomlst, grade, isomax, chiralmax, occurs, occurmols, cycles, chargelist
 *         return atomlst, grade, isomax, chiralmax, cycles, chargelist             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_cycles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_atomlst);
  __Pyx_GIVEREF(__pyx_v_atomlst);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_atomlst);
  __Pyx_INCREF(__pyx_v_grade);
  __Pyx_GIVEREF(__pyx_v_grade);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_grade);
  __Pyx_INCREF(__pyx_v_isomax);
  __Pyx_GIVEREF(__pyx_v_isomax);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_isomax);
  __Pyx_INCREF(__pyx_v_chiralmax);
  __Pyx_GIVEREF(__pyx_v_chiralmax);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_chiralmax);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_chargelist);
  __Pyx_GIVEREF(__pyx_v_chargelist);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_chargelist);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":596
 *         return "\n".join(tl)
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule             # <<<<<<<<<<<<<<
 *         atomlst = []
 *         atomoccur = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule._analyseinitiale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_atomlst);
  __Pyx_XDECREF(__pyx_v_atomoccur);
  __Pyx_XDECREF(__pyx_v_gradeoccur);
  __Pyx_XDECREF(__pyx_v_isooccur);
  __Pyx_XDECREF(__pyx_v_chiraloccur);
  __Pyx_XDECREF(__pyx_v_isomax);
  __Pyx_XDECREF(__pyx_v_chiralmax);
  __Pyx_XDECREF(__pyx_v_grade);
  __Pyx_XDECREF(__pyx_v_cyclelist);
  __Pyx_XDECREF(__pyx_v_chargelist);
  __Pyx_XDECREF(__pyx_v_occurs);
  __Pyx_XDECREF(__pyx_v_occurmols);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_charge);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":667
 * 
 * #-------------------------------------------------------------------------------
 *     def analyse(self, atoms=[], grade=0, iso=0, chiral=0, charge=0, occurs=None, occurmols=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Analysis of a token list.
 *         The purpose is to extract:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_18__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(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_atoms);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_atoms);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_atoms);
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_0));
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_0));
  __Pyx_INCREF(((PyObject *)__pyx_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(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __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.metamolecule.__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_12metamolecule_12MetaMolecule_35analyse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_34analyse[] = "Analysis of a token list.\n        The purpose is to extract:\n                \n         - list of atoms \n         - maximum grade of atoms\n         - maximum of isomerism\n         - maximum of chirality\n         - every atom occurence\n         - every structure occurence\n            \n        Parameters are:  \n              \n         - self -> list to analyse. Created by parser.smiles2toklists\n         - atoms -> list of qatoms to process (default [])\n         - grade -> minimum of detected grade (default 0)\n         - iso -> minimum of detected isomerism (default 0) \n         - chiral -> minimum of detected chirality (default 0) \n         - charge -> minimum of detected charge (default 0) \n         - occurs -> dictionary of minimum atom occurences detected (default None) \n         - occurmols -> dictionary of minimum structure occurences detected (default None)  \n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_35analyse = {"analyse", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_35analyse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_34analyse};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_35analyse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_atoms = 0;
  PyObject *__pyx_v_grade = 0;
  PyObject *__pyx_v_iso = 0;
  PyObject *__pyx_v_chiral = 0;
  CYTHON_UNUSED PyObject *__pyx_v_charge = 0;
  PyObject *__pyx_v_occurs = 0;
  PyObject *__pyx_v_occurmols = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("analyse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_atoms,&__pyx_n_s_grade,&__pyx_n_s_iso_2,&__pyx_n_s_chiral,&__pyx_n_s_charge,&__pyx_n_s_occurs,&__pyx_n_s_occurmols,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_atoms;
    values[2] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((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  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_grade);
          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_iso_2);
          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_chiral);
          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_charge);
          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_occurs);
          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_occurmols);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "analyse") < 0)) __PYX_ERR(0, 667, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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_grade = values[2];
    __pyx_v_iso = values[3];
    __pyx_v_chiral = values[4];
    __pyx_v_charge = values[5];
    __pyx_v_occurs = values[6];
    __pyx_v_occurmols = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("analyse", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.analyse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_34analyse(__pyx_self, __pyx_v_self, __pyx_v_atoms, __pyx_v_grade, __pyx_v_iso, __pyx_v_chiral, __pyx_v_charge, __pyx_v_occurs, __pyx_v_occurmols);

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

/* "metaphor/chem_gm/core/metamolecule.py":690
 *         """
 *         if occurs is None:
 *             occurs = defaultdict(lambda:0)             # <<<<<<<<<<<<<<
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)
 */

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

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

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

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

/* "metaphor/chem_gm/core/metamolecule.py":692
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)             # <<<<<<<<<<<<<<
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 *         for val in occurmolsloc:
 */

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

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

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

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

/* "metaphor/chem_gm/core/metamolecule.py":667
 * 
 * #-------------------------------------------------------------------------------
 *     def analyse(self, atoms=[], grade=0, iso=0, chiral=0, charge=0, occurs=None, occurmols=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Analysis of a token list.
 *         The purpose is to extract:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_34analyse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_grade, PyObject *__pyx_v_iso, PyObject *__pyx_v_chiral, CYTHON_UNUSED PyObject *__pyx_v_charge, PyObject *__pyx_v_occurs, PyObject *__pyx_v_occurmols) {
  PyObject *__pyx_v_resloc = NULL;
  PyObject *__pyx_v_gradeloc = NULL;
  PyObject *__pyx_v_isoloc = NULL;
  PyObject *__pyx_v_chiralloc = NULL;
  PyObject *__pyx_v_occursloc = NULL;
  PyObject *__pyx_v_occurmolsloc = NULL;
  PyObject *__pyx_v_cycleloc = NULL;
  PyObject *__pyx_v_chargelist = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  __Pyx_RefNannySetupContext("analyse", 0);
  __Pyx_INCREF(__pyx_v_grade);
  __Pyx_INCREF(__pyx_v_iso);
  __Pyx_INCREF(__pyx_v_chiral);
  __Pyx_INCREF(__pyx_v_occurs);
  __Pyx_INCREF(__pyx_v_occurmols);

  /* "metaphor/chem_gm/core/metamolecule.py":689
 *          - occurmols -> dictionary of minimum structure occurences detected (default None)
 *         """
 *         if occurs is None:             # <<<<<<<<<<<<<<
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:
 */
  __pyx_t_1 = (__pyx_v_occurs == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":690
 *         """
 *         if occurs is None:
 *             occurs = defaultdict(lambda:0)             # <<<<<<<<<<<<<<
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7analyse_lambda7, 0, __pyx_n_s_MetaMolecule_analyse_locals_lamb, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __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_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_occurs, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":689
 *          - occurmols -> dictionary of minimum structure occurences detected (default None)
 *         """
 *         if occurs is None:             # <<<<<<<<<<<<<<
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":691
 *         if occurs is None:
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:             # <<<<<<<<<<<<<<
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 */
  __pyx_t_2 = (__pyx_v_occurmols == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "metaphor/chem_gm/core/metamolecule.py":692
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)             # <<<<<<<<<<<<<<
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 *         for val in occurmolsloc:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7analyse_1lambda8, 0, __pyx_n_s_MetaMolecule_analyse_locals_lamb, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_occurmols, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":691
 *         if occurs is None:
 *             occurs = defaultdict(lambda:0)
 *         if occurmols is None:             # <<<<<<<<<<<<<<
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":693
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)             # <<<<<<<<<<<<<<
 *         for val in occurmolsloc:
 *             occurmols[val] += 1
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_analyseinitiale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 693, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 693, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
    __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 8) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 693, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_resloc = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_gradeloc = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_isoloc = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_chiralloc = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_occursloc = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_occurmolsloc = __pyx_t_9;
  __pyx_t_9 = 0;
  __pyx_v_cycleloc = __pyx_t_10;
  __pyx_t_10 = 0;
  __pyx_v_chargelist = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":694
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 *         for val in occurmolsloc:             # <<<<<<<<<<<<<<
 *             occurmols[val] += 1
 *         atoms.extend([val for val in resloc if not val in atoms])
 */
  if (likely(PyList_CheckExact(__pyx_v_occurmolsloc)) || PyTuple_CheckExact(__pyx_v_occurmolsloc)) {
    __pyx_t_4 = __pyx_v_occurmolsloc; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_occurmolsloc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 694, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_11); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 694, __pyx_L1_error)
        #else
        __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 694, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
      } else {
        if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_11); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 694, __pyx_L1_error)
        #else
        __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 694, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
      }
    } else {
      __pyx_t_11 = __pyx_t_15(__pyx_t_4);
      if (unlikely(!__pyx_t_11)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 694, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_11);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":695
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 *         for val in occurmolsloc:
 *             occurmols[val] += 1             # <<<<<<<<<<<<<<
 *         atoms.extend([val for val in resloc if not val in atoms])
 *         atoms.sort(key=keyAtoms)
 */
    __Pyx_INCREF(__pyx_v_val);
    __pyx_t_11 = __pyx_v_val;
    __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_occurmols, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_occurmols, __pyx_t_11, __pyx_t_9) < 0)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":694
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)
 *         for val in occurmolsloc:             # <<<<<<<<<<<<<<
 *             occurmols[val] += 1
 *         atoms.extend([val for val in resloc if not val in atoms])
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":696
 *         for val in occurmolsloc:
 *             occurmols[val] += 1
 *         atoms.extend([val for val in resloc if not val in atoms])             # <<<<<<<<<<<<<<
 *         atoms.sort(key=keyAtoms)
 *         iso = max(iso, isoloc)
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_extend); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  { /* enter inner scope */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (likely(PyList_CheckExact(__pyx_v_resloc)) || PyTuple_CheckExact(__pyx_v_resloc)) {
      __pyx_t_10 = __pyx_v_resloc; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_resloc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 696, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 696, __pyx_L11_error)
    }
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_8); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 696, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_8); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 696, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_15(__pyx_t_10);
        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, 696, __pyx_L11_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_val, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr14__pyx_v_val, __pyx_v_atoms, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 696, __pyx_L11_error)
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_9genexpr14__pyx_v_val))) __PYX_ERR(0, 696, __pyx_L11_error)
      }
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_val); __pyx_9genexpr14__pyx_v_val = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_val); __pyx_9genexpr14__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_11)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":697
 *             occurmols[val] += 1
 *         atoms.extend([val for val in resloc if not val in atoms])
 *         atoms.sort(key=keyAtoms)             # <<<<<<<<<<<<<<
 *         iso = max(iso, isoloc)
 *         grade = max(grade, gradeloc)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_atoms, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_keyAtoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":698
 *         atoms.extend([val for val in resloc if not val in atoms])
 *         atoms.sort(key=keyAtoms)
 *         iso = max(iso, isoloc)             # <<<<<<<<<<<<<<
 *         grade = max(grade, gradeloc)
 *         chiral = max(chiral, chiralloc)
 */
  __Pyx_INCREF(__pyx_v_isoloc);
  __pyx_t_8 = __pyx_v_isoloc;
  __Pyx_INCREF(__pyx_v_iso);
  __pyx_t_11 = __pyx_v_iso;
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 698, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_4 = __pyx_t_8;
  } else {
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_4 = __pyx_t_11;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_iso, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":699
 *         atoms.sort(key=keyAtoms)
 *         iso = max(iso, isoloc)
 *         grade = max(grade, gradeloc)             # <<<<<<<<<<<<<<
 *         chiral = max(chiral, chiralloc)
 *         #charge = max(charge, abs(chargelist))
 */
  __Pyx_INCREF(__pyx_v_gradeloc);
  __pyx_t_8 = __pyx_v_gradeloc;
  __Pyx_INCREF(__pyx_v_grade);
  __pyx_t_4 = __pyx_v_grade;
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 699, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_11 = __pyx_t_8;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_11 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __pyx_t_11;
  __Pyx_INCREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF_SET(__pyx_v_grade, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":700
 *         iso = max(iso, isoloc)
 *         grade = max(grade, gradeloc)
 *         chiral = max(chiral, chiralloc)             # <<<<<<<<<<<<<<
 *         #charge = max(charge, abs(chargelist))
 *         for key in occursloc.keys():
 */
  __Pyx_INCREF(__pyx_v_chiralloc);
  __pyx_t_8 = __pyx_v_chiralloc;
  __Pyx_INCREF(__pyx_v_chiral);
  __pyx_t_11 = __pyx_v_chiral;
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 700, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_4 = __pyx_t_8;
  } else {
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_4 = __pyx_t_11;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_chiral, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":702
 *         chiral = max(chiral, chiralloc)
 *         #charge = max(charge, abs(chargelist))
 *         for key in occursloc.keys():             # <<<<<<<<<<<<<<
 *             occurs[key] += occursloc[key]
 *         return atoms, grade, iso, chiral, occurs, occurmols, cycleloc, chargelist
 */
  __pyx_t_14 = 0;
  if (unlikely(__pyx_v_occursloc == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
    __PYX_ERR(0, 702, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_occursloc, 0, __pyx_n_s_keys, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __pyx_t_8 = __pyx_t_4;
  __pyx_t_4 = 0;
  while (1) {
    __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_16, &__pyx_t_14, &__pyx_t_4, NULL, NULL, __pyx_t_17);
    if (unlikely(__pyx_t_18 == 0)) break;
    if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":703
 *         #charge = max(charge, abs(chargelist))
 *         for key in occursloc.keys():
 *             occurs[key] += occursloc[key]             # <<<<<<<<<<<<<<
 *         return atoms, grade, iso, chiral, occurs, occurmols, cycleloc, chargelist
 * 
 */
    __Pyx_INCREF(__pyx_v_key);
    __pyx_t_4 = __pyx_v_key;
    __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_occurs, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_occursloc, __pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_occurs, __pyx_t_4, __pyx_t_10) < 0)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":704
 *         for key in occursloc.keys():
 *             occurs[key] += occursloc[key]
 *         return atoms, grade, iso, chiral, occurs, occurmols, cycleloc, chargelist             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_atoms);
  __Pyx_GIVEREF(__pyx_v_atoms);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_atoms);
  __Pyx_INCREF(__pyx_v_grade);
  __Pyx_GIVEREF(__pyx_v_grade);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_grade);
  __Pyx_INCREF(__pyx_v_iso);
  __Pyx_GIVEREF(__pyx_v_iso);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_iso);
  __Pyx_INCREF(__pyx_v_chiral);
  __Pyx_GIVEREF(__pyx_v_chiral);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_chiral);
  __Pyx_INCREF(__pyx_v_occurs);
  __Pyx_GIVEREF(__pyx_v_occurs);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_occurs);
  __Pyx_INCREF(__pyx_v_occurmols);
  __Pyx_GIVEREF(__pyx_v_occurmols);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_occurmols);
  __Pyx_INCREF(__pyx_v_cycleloc);
  __Pyx_GIVEREF(__pyx_v_cycleloc);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_v_cycleloc);
  __Pyx_INCREF(__pyx_v_chargelist);
  __Pyx_GIVEREF(__pyx_v_chargelist);
  PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_v_chargelist);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":667
 * 
 * #-------------------------------------------------------------------------------
 *     def analyse(self, atoms=[], grade=0, iso=0, chiral=0, charge=0, occurs=None, occurmols=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Analysis of a token list.
 *         The purpose is to extract:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.analyse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_resloc);
  __Pyx_XDECREF(__pyx_v_gradeloc);
  __Pyx_XDECREF(__pyx_v_isoloc);
  __Pyx_XDECREF(__pyx_v_chiralloc);
  __Pyx_XDECREF(__pyx_v_occursloc);
  __Pyx_XDECREF(__pyx_v_occurmolsloc);
  __Pyx_XDECREF(__pyx_v_cycleloc);
  __Pyx_XDECREF(__pyx_v_chargelist);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_grade);
  __Pyx_XDECREF(__pyx_v_iso);
  __Pyx_XDECREF(__pyx_v_chiral);
  __Pyx_XDECREF(__pyx_v_occurs);
  __Pyx_XDECREF(__pyx_v_occurmols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":707
 * 
 * #-------------------------------------------------------------------------------
 *     def computedistances(self, includebroken=False, maxiter=1000):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the distances in the molecule.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_37computedistances(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_36computedistances[] = "Compute the distances in the molecule.\n        \n        The attribute \"distances\" of each token becomes a vector nparray holding the\n        distances to indexed tokens.\n        self.__smitokens is the list of the SmiToken tokens\n    \n        The algorithm used is based on the adjacent matrix method proposed by A. Goulon.\n            ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_37computedistances = {"computedistances", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_37computedistances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_36computedistances};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_37computedistances(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_includebroken = 0;
  PyObject *__pyx_v_maxiter = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("computedistances (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_includebroken,&__pyx_n_s_maxiter,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_1000));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_includebroken);
          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_maxiter);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computedistances") < 0)) __PYX_ERR(0, 707, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_includebroken = values[1];
    __pyx_v_maxiter = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("computedistances", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 707, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.computedistances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_36computedistances(__pyx_self, __pyx_v_self, __pyx_v_includebroken, __pyx_v_maxiter);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_36computedistances(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_includebroken, PyObject *__pyx_v_maxiter) {
  Py_ssize_t __pyx_v_ll;
  PyObject *__pyx_v_Madj = NULL;
  PyObject *__pyx_v_MDist = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_Mnadj = NULL;
  PyObject *__pyx_v_test = 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)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("computedistances", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":716
 *         The algorithm used is based on the adjacent matrix method proposed by A. Goulon.
 *             """
 *         ll = len(self.__smitokens)             # <<<<<<<<<<<<<<
 *         if not ll:
 *             return None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __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, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ll = __pyx_t_2;

  /* "metaphor/chem_gm/core/metamolecule.py":717
 *             """
 *         ll = len(self.__smitokens)
 *         if not ll:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_3 = ((!(__pyx_v_ll != 0)) != 0);
  if (__pyx_t_3) {

    /* "metaphor/chem_gm/core/metamolecule.py":718
 *         ll = len(self.__smitokens)
 *         if not ll:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         Madj = np.zeros((ll, ll), dtype=int)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":717
 *             """
 *         ll = len(self.__smitokens)
 *         if not ll:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":720
 *             return None
 * 
 *         Madj = np.zeros((ll, ll), dtype=int)             # <<<<<<<<<<<<<<
 *         MDist = np.zeros((ll, ll), dtype=int)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_Madj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":721
 * 
 *         Madj = np.zeros((ll, ll), dtype=int)
 *         MDist = np.zeros((ll, ll), dtype=int)             # <<<<<<<<<<<<<<
 * 
 *         for ind, tok in enumerate(self.__smitokens):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 721, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_MDist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":723
 *         MDist = np.zeros((ll, ll), dtype=int)
 * 
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             V = Madj[ind]
 *             for bond in tok.cbonds:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 723, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":724
 * 
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = Madj[ind]             # <<<<<<<<<<<<<<
 *             for bond in tok.cbonds:
 *                 #if not bond in tok._b rokenbonds:
 */
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_Madj, __pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":725
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = Madj[ind]
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 #if not bond in tok._b rokenbonds:
 *                 if includebroken or not bond.modelbroken:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 725, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 725, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":727
 *             for bond in tok.cbonds:
 *                 #if not bond in tok._b rokenbonds:
 *                 if includebroken or not bond.modelbroken:             # <<<<<<<<<<<<<<
 *                     V[bond.linkedto(tok).numero] = 1
 *         index = 1
 */
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_includebroken); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
      if (!__pyx_t_10) {
      } else {
        __pyx_t_3 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_modelbroken); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = ((!__pyx_t_10) != 0);
      __pyx_t_3 = __pyx_t_11;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_3) {

        /* "metaphor/chem_gm/core/metamolecule.py":728
 *                 #if not bond in tok._b rokenbonds:
 *                 if includebroken or not bond.modelbroken:
 *                     V[bond.linkedto(tok).numero] = 1             # <<<<<<<<<<<<<<
 *         index = 1
 *         Mnadj = Madj.copy()
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_tok); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_tok};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_tok};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 728, __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_INCREF(__pyx_v_tok);
            __Pyx_GIVEREF(__pyx_v_tok);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_tok);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_numero); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_V, __pyx_t_12, __pyx_int_1) < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":727
 *             for bond in tok.cbonds:
 *                 #if not bond in tok._b rokenbonds:
 *                 if includebroken or not bond.modelbroken:             # <<<<<<<<<<<<<<
 *                     V[bond.linkedto(tok).numero] = 1
 *         index = 1
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":725
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = Madj[ind]
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 #if not bond in tok._b rokenbonds:
 *                 if includebroken or not bond.modelbroken:
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":723
 *         MDist = np.zeros((ll, ll), dtype=int)
 * 
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             V = Madj[ind]
 *             for bond in tok.cbonds:
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":729
 *                 if includebroken or not bond.modelbroken:
 *                     V[bond.linkedto(tok).numero] = 1
 *         index = 1             # <<<<<<<<<<<<<<
 *         Mnadj = Madj.copy()
 *         test = adj2dist(Mnadj, MDist, index, ll)
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_index = __pyx_int_1;

  /* "metaphor/chem_gm/core/metamolecule.py":730
 *                     V[bond.linkedto(tok).numero] = 1
 *         index = 1
 *         Mnadj = Madj.copy()             # <<<<<<<<<<<<<<
 *         test = adj2dist(Mnadj, MDist, index, ll)
 *         #test = testMatriceDistances(Mnadj, ll)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Madj, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_Mnadj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":731
 *         index = 1
 *         Mnadj = Madj.copy()
 *         test = adj2dist(Mnadj, MDist, index, ll)             # <<<<<<<<<<<<<<
 *         #test = testMatriceDistances(Mnadj, ll)
 *         while not test and (index < maxiter):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_adj2dist); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = NULL;
  __pyx_t_15 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_15 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[5] = {__pyx_t_12, __pyx_v_Mnadj, __pyx_v_MDist, __pyx_v_index, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[5] = {__pyx_t_12, __pyx_v_Mnadj, __pyx_v_MDist, __pyx_v_index, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(4+__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_INCREF(__pyx_v_Mnadj);
    __Pyx_GIVEREF(__pyx_v_Mnadj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_15, __pyx_v_Mnadj);
    __Pyx_INCREF(__pyx_v_MDist);
    __Pyx_GIVEREF(__pyx_v_MDist);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_15, __pyx_v_MDist);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_15, __pyx_v_index);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_15, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_test = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":733
 *         test = adj2dist(Mnadj, MDist, index, ll)
 *         #test = testMatriceDistances(Mnadj, ll)
 *         while not test and (index < maxiter):             # <<<<<<<<<<<<<<
 *             index += 1
 *             Mnadj = Mnadj.dot(Madj)
 */
  while (1) {
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_test); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 733, __pyx_L1_error)
    __pyx_t_10 = ((!__pyx_t_11) != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_3 = __pyx_t_10;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_maxiter, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_10;
    __pyx_L13_bool_binop_done:;
    if (!__pyx_t_3) break;

    /* "metaphor/chem_gm/core/metamolecule.py":734
 *         #test = testMatriceDistances(Mnadj, ll)
 *         while not test and (index < maxiter):
 *             index += 1             # <<<<<<<<<<<<<<
 *             Mnadj = Mnadj.dot(Madj)
 *             test = adj2dist(Mnadj, MDist, index, ll)
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":735
 *         while not test and (index < maxiter):
 *             index += 1
 *             Mnadj = Mnadj.dot(Madj)             # <<<<<<<<<<<<<<
 *             test = adj2dist(Mnadj, MDist, index, ll)
 *             #test = testMatriceDistances(Mnadj, ll)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_Mnadj, __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_Madj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_Madj};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_Madj};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_Madj);
        __Pyx_GIVEREF(__pyx_v_Madj);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_Madj);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_Mnadj, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":736
 *             index += 1
 *             Mnadj = Mnadj.dot(Madj)
 *             test = adj2dist(Mnadj, MDist, index, ll)             # <<<<<<<<<<<<<<
 *             #test = testMatriceDistances(Mnadj, ll)
 *         self.computedistancesindex = index
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_adj2dist); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_ll); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    __pyx_t_15 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_15 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_Mnadj, __pyx_v_MDist, __pyx_v_index, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_Mnadj, __pyx_v_MDist, __pyx_v_index, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 4+__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(4+__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_Mnadj);
      __Pyx_GIVEREF(__pyx_v_Mnadj);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_15, __pyx_v_Mnadj);
      __Pyx_INCREF(__pyx_v_MDist);
      __Pyx_GIVEREF(__pyx_v_MDist);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_15, __pyx_v_MDist);
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_15, __pyx_v_index);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_15, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_test, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":738
 *             test = adj2dist(Mnadj, MDist, index, ll)
 *             #test = testMatriceDistances(Mnadj, ll)
 *         self.computedistancesindex = index             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = MDist[ind].copy()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_computedistancesindex, __pyx_v_index) < 0) __PYX_ERR(0, 738, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":739
 *             #test = testMatriceDistances(Mnadj, ll)
 *         self.computedistancesindex = index
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             V = MDist[ind].copy()
 *             tok._distances = V
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_12 = __pyx_t_5; __Pyx_INCREF(__pyx_t_12); __pyx_t_2 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_12))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_12)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_12);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 739, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":740
 *         self.computedistancesindex = index
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = MDist[ind].copy()             # <<<<<<<<<<<<<<
 *             tok._distances = V
 *         return MDist
 */
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_MDist, __pyx_v_ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":741
 *         for ind, tok in enumerate(self.__smitokens):
 *             V = MDist[ind].copy()
 *             tok._distances = V             # <<<<<<<<<<<<<<
 *         return MDist
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_distances, __pyx_v_V) < 0) __PYX_ERR(0, 741, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":739
 *             #test = testMatriceDistances(Mnadj, ll)
 *         self.computedistancesindex = index
 *         for ind, tok in enumerate(self.__smitokens):             # <<<<<<<<<<<<<<
 *             V = MDist[ind].copy()
 *             tok._distances = V
 */
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":742
 *             V = MDist[ind].copy()
 *             tok._distances = V
 *         return MDist             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_MDist);
  __pyx_r = __pyx_v_MDist;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":707
 * 
 * #-------------------------------------------------------------------------------
 *     def computedistances(self, includebroken=False, maxiter=1000):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the distances in the molecule.
 * 
 */

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.computedistances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Madj);
  __Pyx_XDECREF(__pyx_v_MDist);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_Mnadj);
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":745
 * 
 * #-------------------------------------------------------------------------------
 *     def tallyDistanceIndexes(self, outputindex=0): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the class indexes of tokens.
 *         The algorithm of class computation is:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_39tallyDistanceIndexes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_38tallyDistanceIndexes[] = "Compute the class indexes of tokens. \n        The algorithm of class computation is:\n        \n         - To be written.\n          \n        For each token in the list, the attribute \"distanceIndex\" is computed.\n        \"tokens\" is the list of the 'Smitoken' tokens.\n        \"outputindex\" define the output type:\n        \n         0. return a 2-tuple  (tokens, cmax) where cmax is the higher class.\n         1. return tokens\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_39tallyDistanceIndexes = {"tallyDistanceIndexes", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_39tallyDistanceIndexes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_38tallyDistanceIndexes};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_39tallyDistanceIndexes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_outputindex = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tallyDistanceIndexes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_outputindex,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outputindex);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tallyDistanceIndexes") < 0)) __PYX_ERR(0, 745, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_outputindex = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tallyDistanceIndexes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 745, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.tallyDistanceIndexes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_38tallyDistanceIndexes(__pyx_self, __pyx_v_self, __pyx_v_outputindex);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_38tallyDistanceIndexes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_outputindex) {
  PyObject *__pyx_v_cmax = NULL;
  PyObject *__pyx_v_cmin = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("tallyDistanceIndexes", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":758
 *          1. return tokens
 *         """
 *         cmax = -1             # <<<<<<<<<<<<<<
 *         cmin = 0x8FFF
 *         # on clacule les distanceIndex, et les min et max de distanceIndex
 */
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_v_cmax = __pyx_int_neg_1;

  /* "metaphor/chem_gm/core/metamolecule.py":759
 *         """
 *         cmax = -1
 *         cmin = 0x8FFF             # <<<<<<<<<<<<<<
 *         # on clacule les distanceIndex, et les min et max de distanceIndex
 *         for tok in self.__smitokens:
 */
  __Pyx_INCREF(__pyx_int_36863);
  __pyx_v_cmin = __pyx_int_36863;

  /* "metaphor/chem_gm/core/metamolecule.py":761
 *         cmin = 0x8FFF
 *         # on clacule les distanceIndex, et les min et max de distanceIndex
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             # la valeur de tok.distanceIndex est calcule lors de la premire lecture.
 *             # Cf le getter de la propriete distanceIndex
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 761, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":764
 *             # la valeur de tok.distanceIndex est calcule lors de la premire lecture.
 *             # Cf le getter de la propriete distanceIndex
 *             cmax = max(cmax, tok.distanceIndex)             # <<<<<<<<<<<<<<
 *             cmin = min(cmin, tok.distanceIndex)
 *         for tok in self.__smitokens:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_distanceIndex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cmax);
    __pyx_t_5 = __pyx_v_cmax;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1;
    } else {
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __pyx_t_5;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_cmax, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":765
 *             # Cf le getter de la propriete distanceIndex
 *             cmax = max(cmax, tok.distanceIndex)
 *             cmin = min(cmin, tok.distanceIndex)             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             # pour chaque jeton
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_distanceIndex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cmin);
    __pyx_t_6 = __pyx_v_cmin;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 765, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_t_1;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_5 = __pyx_t_6;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_cmin, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":761
 *         cmin = 0x8FFF
 *         # on clacule les distanceIndex, et les min et max de distanceIndex
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             # la valeur de tok.distanceIndex est calcule lors de la premire lecture.
 *             # Cf le getter de la propriete distanceIndex
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":766
 *             cmax = max(cmax, tok.distanceIndex)
 *             cmin = min(cmin, tok.distanceIndex)
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             # pour chaque jeton
 *             if tok.valence == 1:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 766, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":768
 *         for tok in self.__smitokens:
 *             # pour chaque jeton
 *             if tok.valence == 1:             # <<<<<<<<<<<<<<
 *             # si la valence est 1, l'index de classe est mis  max +1
 *                 tok._distanceIndex = cmax+1
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_valence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {

      /* "metaphor/chem_gm/core/metamolecule.py":770
 *             if tok.valence == 1:
 *             # si la valence est 1, l'index de classe est mis  max +1
 *                 tok._distanceIndex = cmax+1             # <<<<<<<<<<<<<<
 *             # puis l'index de classe est ramen  base 0
 *             tok._distanceIndex -= cmin
 */
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_cmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_distanceIndex_2, __pyx_t_5) < 0) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":768
 *         for tok in self.__smitokens:
 *             # pour chaque jeton
 *             if tok.valence == 1:             # <<<<<<<<<<<<<<
 *             # si la valence est 1, l'index de classe est mis  max +1
 *                 tok._distanceIndex = cmax+1
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":772
 *                 tok._distanceIndex = cmax+1
 *             # puis l'index de classe est ramen  base 0
 *             tok._distanceIndex -= cmin             # <<<<<<<<<<<<<<
 *         if not outputindex:
 *             return self
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_distanceIndex_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_t_5, __pyx_v_cmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_distanceIndex_2, __pyx_t_2) < 0) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":766
 *             cmax = max(cmax, tok.distanceIndex)
 *             cmin = min(cmin, tok.distanceIndex)
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             # pour chaque jeton
 *             if tok.valence == 1:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":773
 *             # puis l'index de classe est ramen  base 0
 *             tok._distanceIndex -= cmin
 *         if not outputindex:             # <<<<<<<<<<<<<<
 *             return self
 *         cmax = cmax+1 - cmin
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_outputindex); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 773, __pyx_L1_error)
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "metaphor/chem_gm/core/metamolecule.py":774
 *             tok._distanceIndex -= cmin
 *         if not outputindex:
 *             return self             # <<<<<<<<<<<<<<
 *         cmax = cmax+1 - cmin
 *         if outputindex >= 1:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":773
 *             # puis l'index de classe est ramen  base 0
 *             tok._distanceIndex -= cmin
 *         if not outputindex:             # <<<<<<<<<<<<<<
 *             return self
 *         cmax = cmax+1 - cmin
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":775
 *         if not outputindex:
 *             return self
 *         cmax = cmax+1 - cmin             # <<<<<<<<<<<<<<
 *         if outputindex >= 1:
 *             return self, cmax
 */
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_cmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_cmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_cmax, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":776
 *             return self
 *         cmax = cmax+1 - cmin
 *         if outputindex >= 1:             # <<<<<<<<<<<<<<
 *             return self, cmax
 * 
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_outputindex, __pyx_int_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_9) {

    /* "metaphor/chem_gm/core/metamolecule.py":777
 *         cmax = cmax+1 - cmin
 *         if outputindex >= 1:
 *             return self, cmax             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_cmax);
    __Pyx_GIVEREF(__pyx_v_cmax);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cmax);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":776
 *             return self
 *         cmax = cmax+1 - cmin
 *         if outputindex >= 1:             # <<<<<<<<<<<<<<
 *             return self, cmax
 * 
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":745
 * 
 * #-------------------------------------------------------------------------------
 *     def tallyDistanceIndexes(self, outputindex=0): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the class indexes of tokens.
 *         The algorithm of class computation is:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.tallyDistanceIndexes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cmax);
  __Pyx_XDECREF(__pyx_v_cmin);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":780
 * 
 * #-------------------------------------------------------------------------------
 *     def getChargeList(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrive the list of the charged tokens
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_41getChargeList(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_40getChargeList[] = "Retrive the list of the charged tokens\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_41getChargeList = {"getChargeList", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_41getChargeList, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_40getChargeList};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_41getChargeList(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getChargeList (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_40getChargeList(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_40getChargeList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("getChargeList", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":783
 *         """Retrive the list of the charged tokens
 *         """
 *         lst = []             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             val = tok.charge
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lst = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":784
 *         """
 *         lst = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             val = tok.charge
 *             if val and not val in lst:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 784, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":785
 *         lst = []
 *         for tok in self.__smitokens:
 *             val = tok.charge             # <<<<<<<<<<<<<<
 *             if val and not val in lst:
 *                 lst.append(str(val))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_charge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":786
 *         for tok in self.__smitokens:
 *             val = tok.charge
 *             if val and not val in lst:             # <<<<<<<<<<<<<<
 *                 lst.append(str(val))
 *         return lst
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 786, __pyx_L1_error)
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_lst, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 786, __pyx_L1_error)
    __pyx_t_7 = (__pyx_t_6 != 0);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/metamolecule.py":787
 *             val = tok.charge
 *             if val and not val in lst:
 *                 lst.append(str(val))             # <<<<<<<<<<<<<<
 *         return lst
 * #-------------------------------------------------------------------------------
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_lst, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":786
 *         for tok in self.__smitokens:
 *             val = tok.charge
 *             if val and not val in lst:             # <<<<<<<<<<<<<<
 *                 lst.append(str(val))
 *         return lst
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":784
 *         """
 *         lst = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             val = tok.charge
 *             if val and not val in lst:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":788
 *             if val and not val in lst:
 *                 lst.append(str(val))
 *         return lst             # <<<<<<<<<<<<<<
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_lst);
  __pyx_r = __pyx_v_lst;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":780
 * 
 * #-------------------------------------------------------------------------------
 *     def getChargeList(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrive the list of the charged tokens
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getChargeList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_43getCentralAtom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_42getCentralAtom[] = "Retrieve the root atom of the molecule\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_43getCentralAtom = {"getCentralAtom", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_43getCentralAtom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_42getCentralAtom};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_43getCentralAtom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cmax = 0;
  PyObject *__pyx_v_centraux = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCentralAtom (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cmax,&__pyx_n_s_centraux,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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_cmax);
          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_centraux);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCentralAtom") < 0)) __PYX_ERR(0, 790, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cmax = values[1];
    __pyx_v_centraux = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCentralAtom", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 790, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getCentralAtom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_42getCentralAtom(__pyx_self, __pyx_v_self, __pyx_v_cmax, __pyx_v_centraux);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":804
 *             return None
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)             # <<<<<<<<<<<<<<
 *         if not cmax:
 *             return self.__smitokens[0]
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 804, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MetaMolecule_getCentralAtom_loca, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getCentralAtom.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 804, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 804, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 804, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 804, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 804, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tok);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tok, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_distanceIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 804, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "metaphor/chem_gm/core/metamolecule.py":812
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))             # <<<<<<<<<<<<<<
 *             if len(lst):
 *                 #lst.sort(lambda x, y: x.compare(y))
 */

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

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

static PyObject *__pyx_lambda_funcdef_lambda10(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *__pyx_cur_scope;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("lambda10", 0);
  __pyx_outer_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_distanceIndex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_i)) { __Pyx_RaiseClosureNameError("i"); __PYX_ERR(0, 812, __pyx_L1_error) }
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_cur_scope->__pyx_v_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 812, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_v_centraux)) { __Pyx_RaiseClosureNameError("centraux"); __PYX_ERR(0, 812, __pyx_L1_error) }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_cur_scope->__pyx_v_centraux, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getCentralAtom.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_42getCentralAtom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cmax, PyObject *__pyx_v_centraux) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *__pyx_cur_scope;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  __Pyx_RefNannySetupContext("getCentralAtom", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 790, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_centraux = __pyx_v_centraux;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_centraux);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_centraux);
  __Pyx_INCREF(__pyx_v_cmax);

  /* "metaphor/chem_gm/core/metamolecule.py":794
 *         """
 *         #recherche initiale des atomes de applidata=1 ou 3
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.applidata in (1, 3):
 *                 return tok
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 794, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":795
 *         #recherche initiale des atomes de applidata=1 ou 3
 *         for tok in self.__smitokens:
 *             if tok.applidata in (1, 3):             # <<<<<<<<<<<<<<
 *                 return tok
 *         # recherche de l'atome central d'une liste
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_applidata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!__pyx_t_7) {
    } else {
      __pyx_t_5 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (__pyx_t_7) {

      /* "metaphor/chem_gm/core/metamolecule.py":796
 *         for tok in self.__smitokens:
 *             if tok.applidata in (1, 3):
 *                 return tok             # <<<<<<<<<<<<<<
 *         # recherche de l'atome central d'une liste
 *         # self: liste des jetons atomes
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_tok);
      __pyx_r = __pyx_v_tok;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "metaphor/chem_gm/core/metamolecule.py":795
 *         #recherche initiale des atomes de applidata=1 ou 3
 *         for tok in self.__smitokens:
 *             if tok.applidata in (1, 3):             # <<<<<<<<<<<<<<
 *                 return tok
 *         # recherche de l'atome central d'une liste
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":794
 *         """
 *         #recherche initiale des atomes de applidata=1 ou 3
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.applidata in (1, 3):
 *                 return tok
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":801
 *         # cmax: classe max
 *         # centraux: liste ou ensemble des symboles des atomes admis comme centraux
 *         if centraux is None:             # <<<<<<<<<<<<<<
 *             return None
 *         if not cmax:
 */
  __pyx_t_7 = (__pyx_cur_scope->__pyx_v_centraux == Py_None);
  __pyx_t_5 = (__pyx_t_7 != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/metamolecule.py":802
 *         # centraux: liste ou ensemble des symboles des atomes admis comme centraux
 *         if centraux is None:
 *             return None             # <<<<<<<<<<<<<<
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":801
 *         # cmax: classe max
 *         # centraux: liste ou ensemble des symboles des atomes admis comme centraux
 *         if centraux is None:             # <<<<<<<<<<<<<<
 *             return None
 *         if not cmax:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":803
 *         if centraux is None:
 *             return None
 *         if not cmax:             # <<<<<<<<<<<<<<
 *             cmax = max(tok.distanceIndex for tok in self)
 *         if not cmax:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_cmax); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 803, __pyx_L1_error)
  __pyx_t_7 = ((!__pyx_t_5) != 0);
  if (__pyx_t_7) {

    /* "metaphor/chem_gm/core/metamolecule.py":804
 *             return None
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)             # <<<<<<<<<<<<<<
 *         if not cmax:
 *             return self.__smitokens[0]
 */
    __pyx_t_2 = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_cmax, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":803
 *         if centraux is None:
 *             return None
 *         if not cmax:             # <<<<<<<<<<<<<<
 *             cmax = max(tok.distanceIndex for tok in self)
 *         if not cmax:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":805
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)
 *         if not cmax:             # <<<<<<<<<<<<<<
 *             return self.__smitokens[0]
 *         if not len(centraux):
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_cmax); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_7) != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/metamolecule.py":806
 *             cmax = max(tok.distanceIndex for tok in self)
 *         if not cmax:
 *             return self.__smitokens[0]             # <<<<<<<<<<<<<<
 *         if not len(centraux):
 *             for tok in self.__smitokens:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":805
 *         if not cmax:
 *             cmax = max(tok.distanceIndex for tok in self)
 *         if not cmax:             # <<<<<<<<<<<<<<
 *             return self.__smitokens[0]
 *         if not len(centraux):
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":807
 *         if not cmax:
 *             return self.__smitokens[0]
 *         if not len(centraux):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 if not tok.symbol in centraux:
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_centraux;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_5) {

    /* "metaphor/chem_gm/core/metamolecule.py":808
 *             return self.__smitokens[0]
 *         if not len(centraux):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 if not tok.symbol in centraux:
 *                     centraux.append(tok.symbol)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 808, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":809
 *         if not len(centraux):
 *             for tok in self.__smitokens:
 *                 if not tok.symbol in centraux:             # <<<<<<<<<<<<<<
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_cur_scope->__pyx_v_centraux, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 809, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = (__pyx_t_5 != 0);
      if (__pyx_t_7) {

        /* "metaphor/chem_gm/core/metamolecule.py":810
 *             for tok in self.__smitokens:
 *                 if not tok.symbol in centraux:
 *                     centraux.append(tok.symbol)             # <<<<<<<<<<<<<<
 *         for i in range(cmax+1):
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_centraux, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 810, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":809
 *         if not len(centraux):
 *             for tok in self.__smitokens:
 *                 if not tok.symbol in centraux:             # <<<<<<<<<<<<<<
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":808
 *             return self.__smitokens[0]
 *         if not len(centraux):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 if not tok.symbol in centraux:
 *                     centraux.append(tok.symbol)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":807
 *         if not cmax:
 *             return self.__smitokens[0]
 *         if not len(centraux):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 if not tok.symbol in centraux:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":811
 *                 if not tok.symbol in centraux:
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):             # <<<<<<<<<<<<<<
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))
 *             if len(lst):
 */
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_cmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 811, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 811, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 811, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":812
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))             # <<<<<<<<<<<<<<
 *             if len(lst):
 *                 #lst.sort(lambda x, y: x.compare(y))
 */
    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getCentralAtom_3lambda10, 0, __pyx_n_s_MetaMolecule_getCentralAtom_loca_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_lst, ((PyObject*)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":813
 *         for i in range(cmax+1):
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))
 *             if len(lst):             # <<<<<<<<<<<<<<
 *                 #lst.sort(lambda x, y: x.compare(y))
 *                 lst.sort(key = tokenKeyValue)
 */
    __pyx_t_10 = PyList_GET_SIZE(__pyx_v_lst); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 813, __pyx_L1_error)
    __pyx_t_7 = (__pyx_t_10 != 0);
    if (__pyx_t_7) {

      /* "metaphor/chem_gm/core/metamolecule.py":815
 *             if len(lst):
 *                 #lst.sort(lambda x, y: x.compare(y))
 *                 lst.sort(key = tokenKeyValue)             # <<<<<<<<<<<<<<
 *                 return lst[0]
 *         return None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_sort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tokenKeyValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":816
 *                 #lst.sort(lambda x, y: x.compare(y))
 *                 lst.sort(key = tokenKeyValue)
 *                 return lst[0]             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_lst, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "metaphor/chem_gm/core/metamolecule.py":813
 *         for i in range(cmax+1):
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))
 *             if len(lst):             # <<<<<<<<<<<<<<
 *                 #lst.sort(lambda x, y: x.compare(y))
 *                 lst.sort(key = tokenKeyValue)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":811
 *                 if not tok.symbol in centraux:
 *                     centraux.append(tok.symbol)
 *         for i in range(cmax+1):             # <<<<<<<<<<<<<<
 *             lst = list(filter(lambda x: (x.distanceIndex == i) and (x.symbol in centraux), self.__smitokens))
 *             if len(lst):
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":817
 *                 lst.sort(key = tokenKeyValue)
 *                 return lst[0]
 *         return None             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getCentralAtom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_cmax);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":820
 * 
 * #-------------------------------------------------------------------------------
 *     def getskeleton(self, central, coupurecycles=1): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # cration du squelette du modle a partir du jeton central
 *         # C'est une liste de listes de jetons. Les sous listes sont classes par distance croissante avec le central
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_45getskeleton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_45getskeleton = {"getskeleton", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_45getskeleton, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_45getskeleton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_central = 0;
  PyObject *__pyx_v_coupurecycles = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getskeleton (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_central,&__pyx_n_s_coupurecycles,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_central)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getskeleton", 0, 2, 3, 1); __PYX_ERR(0, 820, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coupurecycles);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getskeleton") < 0)) __PYX_ERR(0, 820, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_central = values[1];
    __pyx_v_coupurecycles = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getskeleton", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getskeleton", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_44getskeleton(__pyx_self, __pyx_v_self, __pyx_v_central, __pyx_v_coupurecycles);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_44getskeleton(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_central, PyObject *__pyx_v_coupurecycles) {
  PyObject *__pyx_v_dmax = NULL;
  PyObject *__pyx_v_skeleton = NULL;
  PyObject *__pyx_v_cycleends = NULL;
  PyObject *__pyx_v_last = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_tok2 = NULL;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_tg1 = NULL;
  PyObject *__pyx_v_tg2 = NULL;
  PyObject *__pyx_v_bond1 = NULL;
  PyObject *__pyx_v_bond2 = NULL;
  PyObject *__pyx_v_elmt = NULL;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_9genexpr16__pyx_v_dist = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_ref = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("getskeleton", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":826
 *         # pas de self.clearbrokens() il ne faut pas vider brokenbonds en raison des
 *         # cesures forcees deja enregistrees
 *         dmax = max(central.distances)             # <<<<<<<<<<<<<<
 * 
 *         skeleton = [[self[i] for i, ref in enumerate(central.distances) if ref == dist] for dist in range(dmax+1)]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_central, __pyx_n_s_distances_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dmax = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":828
 *         dmax = max(central.distances)
 * 
 *         skeleton = [[self[i] for i, ref in enumerate(central.distances) if ref == dist] for dist in range(dmax+1)]             # <<<<<<<<<<<<<<
 *         cycleends = []
 *         # on explore chaque niveau pour trouver les indicateurs de boucle:
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_dmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_1);
        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, 828, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_dist, __pyx_t_3);
      __pyx_t_3 = 0;
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_6 = __pyx_int_0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_central, __pyx_n_s_distances_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 828, __pyx_L10_error)
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (likely(!__pyx_t_10)) {
            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_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L10_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L10_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_10(__pyx_t_8);
            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, 828, __pyx_L10_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_ref, __pyx_t_7);
          __pyx_t_7 = 0;
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_i, __pyx_t_6);
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_t_7;
          __pyx_t_7 = 0;
          __pyx_t_7 = PyObject_RichCompare(__pyx_9genexpr17__pyx_v_ref, __pyx_9genexpr16__pyx_v_dist, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 828, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (__pyx_t_11) {
            __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_self, __pyx_9genexpr17__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_7);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 828, __pyx_L10_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_i); __pyx_9genexpr17__pyx_v_i = 0;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ref); __pyx_9genexpr17__pyx_v_ref = 0;
        goto __pyx_L14_exit_scope;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_i); __pyx_9genexpr17__pyx_v_i = 0;
        __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ref); __pyx_9genexpr17__pyx_v_ref = 0;
        goto __pyx_L5_error;
        __pyx_L14_exit_scope:;
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 828, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_dist); __pyx_9genexpr16__pyx_v_dist = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_dist); __pyx_9genexpr16__pyx_v_dist = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  __pyx_v_skeleton = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":829
 * 
 *         skeleton = [[self[i] for i, ref in enumerate(central.distances) if ref == dist] for dist in range(dmax+1)]
 *         cycleends = []             # <<<<<<<<<<<<<<
 *         # on explore chaque niveau pour trouver les indicateurs de boucle:
 *         # 1 - deux atomes du mme niveau sont lis entre directement eux
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cycleends = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":833
 *         # 1 - deux atomes du mme niveau sont lis entre directement eux
 *         # 2 - un atome de niveau n est li  deux atomes de niveau n-1
 *         last = None             # <<<<<<<<<<<<<<
 *         for lst in skeleton:
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_last = Py_None;

  /* "metaphor/chem_gm/core/metamolecule.py":834
 *         # 2 - un atome de niveau n est li  deux atomes de niveau n-1
 *         last = None
 *         for lst in skeleton:             # <<<<<<<<<<<<<<
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 *                 for tok2 in lst[i+1:]:
 */
  __pyx_t_2 = __pyx_v_skeleton; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 834, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":835
 *         last = None
 *         for lst in skeleton:
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):             # <<<<<<<<<<<<<<
 *                 for tok2 in lst[i+1:]:
 *                     bond = tok.getBondTo(tok2)
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
      __pyx_t_3 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        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_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 835, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":836
 *         for lst in skeleton:
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 *                 for tok2 in lst[i+1:]:             # <<<<<<<<<<<<<<
 *                     bond = tok.getBondTo(tok2)
 *                     if bond: # ici
 */
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_lst, 0, 0, &__pyx_t_6, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 836, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 836, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 836, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_10(__pyx_t_6);
          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, 836, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_v_tok2, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":837
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 *                 for tok2 in lst[i+1:]:
 *                     bond = tok.getBondTo(tok2)             # <<<<<<<<<<<<<<
 *                     if bond: # ici
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_getBondTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_tok2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_tok2};
            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_tok2};
            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 837, __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_INCREF(__pyx_v_tok2);
            __Pyx_GIVEREF(__pyx_v_tok2);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_tok2);
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":838
 *                 for tok2 in lst[i+1:]:
 *                     bond = tok.getBondTo(tok2)
 *                     if bond: # ici             # <<<<<<<<<<<<<<
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:
 */
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_bond); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 838, __pyx_L1_error)
        if (__pyx_t_11) {

          /* "metaphor/chem_gm/core/metamolecule.py":839
 *                     bond = tok.getBondTo(tok2)
 *                     if bond: # ici
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1             # <<<<<<<<<<<<<<
 *                 if last is not None:
 *                     for j, tg1 in enumerate(last):
 */
          __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_v_lst);
          __Pyx_GIVEREF(__pyx_v_lst);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lst);
          __Pyx_INCREF(__pyx_v_tok);
          __Pyx_GIVEREF(__pyx_v_tok);
          PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_tok);
          __Pyx_INCREF(__pyx_v_tok2);
          __Pyx_GIVEREF(__pyx_v_tok2);
          PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_tok2);
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_8, 3, Py_None);
          __Pyx_INCREF(__pyx_v_bond);
          __Pyx_GIVEREF(__pyx_v_bond);
          PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_bond);
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_8, 5, Py_None);
          __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_cycleends, __pyx_t_8); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 839, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":838
 *                 for tok2 in lst[i+1:]:
 *                     bond = tok.getBondTo(tok2)
 *                     if bond: # ici             # <<<<<<<<<<<<<<
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:
 */
        }

        /* "metaphor/chem_gm/core/metamolecule.py":836
 *         for lst in skeleton:
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 *                 for tok2 in lst[i+1:]:             # <<<<<<<<<<<<<<
 *                     bond = tok.getBondTo(tok2)
 *                     if bond: # ici
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":840
 *                     if bond: # ici
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:             # <<<<<<<<<<<<<<
 *                     for j, tg1 in enumerate(last):
 *                         for tg2 in last[j+1:]:
 */
      __pyx_t_11 = (__pyx_v_last != Py_None);
      __pyx_t_16 = (__pyx_t_11 != 0);
      if (__pyx_t_16) {

        /* "metaphor/chem_gm/core/metamolecule.py":841
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:
 *                     for j, tg1 in enumerate(last):             # <<<<<<<<<<<<<<
 *                         for tg2 in last[j+1:]:
 *                             bond1 = tok.getBondTo(tg1)
 */
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_6 = __pyx_int_0;
        if (likely(PyList_CheckExact(__pyx_v_last)) || PyTuple_CheckExact(__pyx_v_last)) {
          __pyx_t_8 = __pyx_v_last; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_last); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 841, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 841, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 841, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_10(__pyx_t_8);
            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, 841, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_v_tg1, __pyx_t_7);
          __pyx_t_7 = 0;
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_6);
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":842
 *                 if last is not None:
 *                     for j, tg1 in enumerate(last):
 *                         for tg2 in last[j+1:]:             # <<<<<<<<<<<<<<
 *                             bond1 = tok.getBondTo(tg1)
 *                             bond2 = tok.getBondTo(tg2)
 */
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_j, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = __Pyx_PyObject_GetSlice(__pyx_v_last, 0, 0, &__pyx_t_7, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (likely(PyList_CheckExact(__pyx_t_14)) || PyTuple_CheckExact(__pyx_t_14)) {
            __pyx_t_7 = __pyx_t_14; __Pyx_INCREF(__pyx_t_7); __pyx_t_17 = 0;
            __pyx_t_18 = NULL;
          } else {
            __pyx_t_17 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_18 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 842, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          for (;;) {
            if (likely(!__pyx_t_18)) {
              if (likely(PyList_CheckExact(__pyx_t_7))) {
                if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_14 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_17); __Pyx_INCREF(__pyx_t_14); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 842, __pyx_L1_error)
                #else
                __pyx_t_14 = PySequence_ITEM(__pyx_t_7, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 842, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_14);
                #endif
              } else {
                if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_17); __Pyx_INCREF(__pyx_t_14); __pyx_t_17++; if (unlikely(0 < 0)) __PYX_ERR(0, 842, __pyx_L1_error)
                #else
                __pyx_t_14 = PySequence_ITEM(__pyx_t_7, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 842, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_14);
                #endif
              }
            } else {
              __pyx_t_14 = __pyx_t_18(__pyx_t_7);
              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, 842, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_14);
            }
            __Pyx_XDECREF_SET(__pyx_v_tg2, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":843
 *                     for j, tg1 in enumerate(last):
 *                         for tg2 in last[j+1:]:
 *                             bond1 = tok.getBondTo(tg1)             # <<<<<<<<<<<<<<
 *                             bond2 = tok.getBondTo(tg2)
 *                             if bond1 and bond2:
 */
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_getBondTo); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 843, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_19 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_13);
              if (likely(__pyx_t_19)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
                __Pyx_INCREF(__pyx_t_19);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_13, function);
              }
            }
            if (!__pyx_t_19) {
              __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_tg1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_13)) {
                PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_v_tg1};
                __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
                PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_v_tg1};
                __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              {
                __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 843, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
                __Pyx_INCREF(__pyx_v_tg1);
                __Pyx_GIVEREF(__pyx_v_tg1);
                PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_tg1);
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_20, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF_SET(__pyx_v_bond1, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":844
 *                         for tg2 in last[j+1:]:
 *                             bond1 = tok.getBondTo(tg1)
 *                             bond2 = tok.getBondTo(tg2)             # <<<<<<<<<<<<<<
 *                             if bond1 and bond2:
 *                                 cycleends.append((lst, tg1, tg2, tok, bond1, bond2))  # fin de boucle de type 2
 */
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_getBondTo); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 844, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_20 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_13);
              if (likely(__pyx_t_20)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
                __Pyx_INCREF(__pyx_t_20);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_13, function);
              }
            }
            if (!__pyx_t_20) {
              __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_tg2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_13)) {
                PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_tg2};
                __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
                PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_tg2};
                __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else
              #endif
              {
                __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 844, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); __pyx_t_20 = NULL;
                __Pyx_INCREF(__pyx_v_tg2);
                __Pyx_GIVEREF(__pyx_v_tg2);
                PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_v_tg2);
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_19, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF_SET(__pyx_v_bond2, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "metaphor/chem_gm/core/metamolecule.py":845
 *                             bond1 = tok.getBondTo(tg1)
 *                             bond2 = tok.getBondTo(tg2)
 *                             if bond1 and bond2:             # <<<<<<<<<<<<<<
 *                                 cycleends.append((lst, tg1, tg2, tok, bond1, bond2))  # fin de boucle de type 2
 *             last = lst
 */
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_bond1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 845, __pyx_L1_error)
            if (__pyx_t_11) {
            } else {
              __pyx_t_16 = __pyx_t_11;
              goto __pyx_L29_bool_binop_done;
            }
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_bond2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 845, __pyx_L1_error)
            __pyx_t_16 = __pyx_t_11;
            __pyx_L29_bool_binop_done:;
            if (__pyx_t_16) {

              /* "metaphor/chem_gm/core/metamolecule.py":846
 *                             bond2 = tok.getBondTo(tg2)
 *                             if bond1 and bond2:
 *                                 cycleends.append((lst, tg1, tg2, tok, bond1, bond2))  # fin de boucle de type 2             # <<<<<<<<<<<<<<
 *             last = lst
 * 
 */
              __pyx_t_14 = PyTuple_New(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_INCREF(__pyx_v_lst);
              __Pyx_GIVEREF(__pyx_v_lst);
              PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_lst);
              __Pyx_INCREF(__pyx_v_tg1);
              __Pyx_GIVEREF(__pyx_v_tg1);
              PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_tg1);
              __Pyx_INCREF(__pyx_v_tg2);
              __Pyx_GIVEREF(__pyx_v_tg2);
              PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_tg2);
              __Pyx_INCREF(__pyx_v_tok);
              __Pyx_GIVEREF(__pyx_v_tok);
              PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_tok);
              __Pyx_INCREF(__pyx_v_bond1);
              __Pyx_GIVEREF(__pyx_v_bond1);
              PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_v_bond1);
              __Pyx_INCREF(__pyx_v_bond2);
              __Pyx_GIVEREF(__pyx_v_bond2);
              PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_v_bond2);
              __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_cycleends, __pyx_t_14); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 846, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

              /* "metaphor/chem_gm/core/metamolecule.py":845
 *                             bond1 = tok.getBondTo(tg1)
 *                             bond2 = tok.getBondTo(tg2)
 *                             if bond1 and bond2:             # <<<<<<<<<<<<<<
 *                                 cycleends.append((lst, tg1, tg2, tok, bond1, bond2))  # fin de boucle de type 2
 *             last = lst
 */
            }

            /* "metaphor/chem_gm/core/metamolecule.py":842
 *                 if last is not None:
 *                     for j, tg1 in enumerate(last):
 *                         for tg2 in last[j+1:]:             # <<<<<<<<<<<<<<
 *                             bond1 = tok.getBondTo(tg1)
 *                             bond2 = tok.getBondTo(tg2)
 */
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":841
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:
 *                     for j, tg1 in enumerate(last):             # <<<<<<<<<<<<<<
 *                         for tg2 in last[j+1:]:
 *                             bond1 = tok.getBondTo(tg1)
 */
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":840
 *                     if bond: # ici
 *                         cycleends.append((lst, tok, tok2, None, bond, None))  # fin de boucle de type 1
 *                 if last is not None:             # <<<<<<<<<<<<<<
 *                     for j, tg1 in enumerate(last):
 *                         for tg2 in last[j+1:]:
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":835
 *         last = None
 *         for lst in skeleton:
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):             # <<<<<<<<<<<<<<
 *                 for tok2 in lst[i+1:]:
 *                     bond = tok.getBondTo(tok2)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":847
 *                             if bond1 and bond2:
 *                                 cycleends.append((lst, tg1, tg2, tok, bond1, bond2))  # fin de boucle de type 2
 *             last = lst             # <<<<<<<<<<<<<<
 * 
 *         # traitement des boucles
 */
    __Pyx_INCREF(__pyx_v_lst);
    __Pyx_DECREF_SET(__pyx_v_last, __pyx_v_lst);

    /* "metaphor/chem_gm/core/metamolecule.py":834
 *         # 2 - un atome de niveau n est li  deux atomes de niveau n-1
 *         last = None
 *         for lst in skeleton:             # <<<<<<<<<<<<<<
 *             for i, tok in enumerate(lst):  #if not tok.applidata in (2, 3):
 *                 for tok2 in lst[i+1:]:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":857
 *         #   1 - il faut faire ajouter un couche pour y mettre l'un des atomes
 *         #   2 - il ne faut rien faire
 *         if coupurecycles:             # <<<<<<<<<<<<<<
 *             for i, elmt in enumerate(cycleends):
 *                 self._ringmodel += 1
 */
  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_coupurecycles); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
  if (__pyx_t_16) {

    /* "metaphor/chem_gm/core/metamolecule.py":858
 *         #   2 - il ne faut rien faire
 *         if coupurecycles:
 *             for i, elmt in enumerate(cycleends):             # <<<<<<<<<<<<<<
 *                 self._ringmodel += 1
 *                 if elmt[3] is None:
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
    __pyx_t_1 = __pyx_v_cycleends; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 858, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_elmt, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":859
 *         if coupurecycles:
 *             for i, elmt in enumerate(cycleends):
 *                 self._ringmodel += 1             # <<<<<<<<<<<<<<
 *                 if elmt[3] is None:
 *                     # coupure 1
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel, __pyx_t_6) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":860
 *             for i, elmt in enumerate(cycleends):
 *                 self._ringmodel += 1
 *                 if elmt[3] is None:             # <<<<<<<<<<<<<<
 *                     # coupure 1
 *                     elmt[4]._modelbroken = self._ringmodel
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elmt, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_16 = (__pyx_t_6 == Py_None);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = (__pyx_t_16 != 0);
      if (__pyx_t_11) {

        /* "metaphor/chem_gm/core/metamolecule.py":862
 *                 if elmt[3] is None:
 *                     # coupure 1
 *                     elmt[4]._modelbroken = self._ringmodel             # <<<<<<<<<<<<<<
 *                 else:
 *                     # coupure 2
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elmt, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_modelbroken_2, __pyx_t_6) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":860
 *             for i, elmt in enumerate(cycleends):
 *                 self._ringmodel += 1
 *                 if elmt[3] is None:             # <<<<<<<<<<<<<<
 *                     # coupure 1
 *                     elmt[4]._modelbroken = self._ringmodel
 */
        goto __pyx_L34;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":865
 *                 else:
 *                     # coupure 2
 *                     target = elmt[1].bestof(elmt[2])             # <<<<<<<<<<<<<<
 *                     if target == elmt[1]:
 *                         elmt[4]._modelbroken = self._ringmodel
 */
      /*else*/ {
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elmt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bestof); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elmt, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 865, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_6);
            __pyx_t_6 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __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_XDECREF_SET(__pyx_v_target, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":866
 *                     # coupure 2
 *                     target = elmt[1].bestof(elmt[2])
 *                     if target == elmt[1]:             # <<<<<<<<<<<<<<
 *                         elmt[4]._modelbroken = self._ringmodel
 *                     else:
 */
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elmt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = PyObject_RichCompare(__pyx_v_target, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (__pyx_t_11) {

          /* "metaphor/chem_gm/core/metamolecule.py":867
 *                     target = elmt[1].bestof(elmt[2])
 *                     if target == elmt[1]:
 *                         elmt[4]._modelbroken = self._ringmodel             # <<<<<<<<<<<<<<
 *                     else:
 *                         elmt[5]._modelbroken = self._ringmodel
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 867, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elmt, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_modelbroken_2, __pyx_t_8) < 0) __PYX_ERR(0, 867, __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/metamolecule.py":866
 *                     # coupure 2
 *                     target = elmt[1].bestof(elmt[2])
 *                     if target == elmt[1]:             # <<<<<<<<<<<<<<
 *                         elmt[4]._modelbroken = self._ringmodel
 *                     else:
 */
          goto __pyx_L35;
        }

        /* "metaphor/chem_gm/core/metamolecule.py":869
 *                         elmt[4]._modelbroken = self._ringmodel
 *                     else:
 *                         elmt[5]._modelbroken = self._ringmodel             # <<<<<<<<<<<<<<
 *         else: # non coupure
 *             for i, elmt in enumerate(cycleends):
 */
        /*else*/ {
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elmt, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 869, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_8, __pyx_n_s_modelbroken_2, __pyx_t_3) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __pyx_L35:;
      }
      __pyx_L34:;

      /* "metaphor/chem_gm/core/metamolecule.py":858
 *         #   2 - il ne faut rien faire
 *         if coupurecycles:
 *             for i, elmt in enumerate(cycleends):             # <<<<<<<<<<<<<<
 *                 self._ringmodel += 1
 *                 if elmt[3] is None:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":857
 *         #   1 - il faut faire ajouter un couche pour y mettre l'un des atomes
 *         #   2 - il ne faut rien faire
 *         if coupurecycles:             # <<<<<<<<<<<<<<
 *             for i, elmt in enumerate(cycleends):
 *                 self._ringmodel += 1
 */
    goto __pyx_L31;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":871
 *                         elmt[5]._modelbroken = self._ringmodel
 *         else: # non coupure
 *             for i, elmt in enumerate(cycleends):             # <<<<<<<<<<<<<<
 *                 if elmt[3] is None:
 *                     target = elmt[1].bestof(elmt[2])
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
    __pyx_t_1 = __pyx_v_cycleends; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 871, __pyx_L1_error)
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_elmt, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":872
 *         else: # non coupure
 *             for i, elmt in enumerate(cycleends):
 *                 if elmt[3] is None:             # <<<<<<<<<<<<<<
 *                     target = elmt[1].bestof(elmt[2])
 *                     ind = elmt[0].index(target)
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elmt, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = (__pyx_t_8 == Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_16 = (__pyx_t_11 != 0);
      if (__pyx_t_16) {

        /* "metaphor/chem_gm/core/metamolecule.py":873
 *             for i, elmt in enumerate(cycleends):
 *                 if elmt[3] is None:
 *                     target = elmt[1].bestof(elmt[2])             # <<<<<<<<<<<<<<
 *                     ind = elmt[0].index(target)
 *                     tok = elmt[0].pop(ind)
 */
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elmt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bestof); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 873, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elmt, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else
          #endif
          {
            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 873, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":874
 *                 if elmt[3] is None:
 *                     target = elmt[1].bestof(elmt[2])
 *                     ind = elmt[0].index(target)             # <<<<<<<<<<<<<<
 *                     tok = elmt[0].pop(ind)
 *                     index = skeleton.index(elmt[0])
 */
        __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_elmt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_target); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_target};
            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_v_target};
            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          {
            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_14); __pyx_t_14 = NULL;
            __Pyx_INCREF(__pyx_v_target);
            __Pyx_GIVEREF(__pyx_v_target);
            PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_target);
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":875
 *                     target = elmt[1].bestof(elmt[2])
 *                     ind = elmt[0].index(target)
 *                     tok = elmt[0].pop(ind)             # <<<<<<<<<<<<<<
 *                     index = skeleton.index(elmt[0])
 *                     skeleton.insert(index, [tok])
 */
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_elmt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_ind};
            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_ind};
            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_8);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 875, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
            __Pyx_INCREF(__pyx_v_ind);
            __Pyx_GIVEREF(__pyx_v_ind);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_ind);
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":876
 *                     ind = elmt[0].index(target)
 *                     tok = elmt[0].pop(ind)
 *                     index = skeleton.index(elmt[0])             # <<<<<<<<<<<<<<
 *                     skeleton.insert(index, [tok])
 *                 else:
 */
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elmt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 876, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_skeleton, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":877
 *                     tok = elmt[0].pop(ind)
 *                     index = skeleton.index(elmt[0])
 *                     skeleton.insert(index, [tok])             # <<<<<<<<<<<<<<
 *                 else:
 *                     pass
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L1_error)
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_tok);
        __Pyx_GIVEREF(__pyx_v_tok);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_tok);
        __pyx_t_15 = PyList_Insert(__pyx_v_skeleton, __pyx_t_9, __pyx_t_3); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 877, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":872
 *         else: # non coupure
 *             for i, elmt in enumerate(cycleends):
 *                 if elmt[3] is None:             # <<<<<<<<<<<<<<
 *                     target = elmt[1].bestof(elmt[2])
 *                     ind = elmt[0].index(target)
 */
        goto __pyx_L38;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":879
 *                     skeleton.insert(index, [tok])
 *                 else:
 *                     pass             # <<<<<<<<<<<<<<
 * 
 *         return skeleton
 */
      /*else*/ {
      }
      __pyx_L38:;

      /* "metaphor/chem_gm/core/metamolecule.py":871
 *                         elmt[5]._modelbroken = self._ringmodel
 *         else: # non coupure
 *             for i, elmt in enumerate(cycleends):             # <<<<<<<<<<<<<<
 *                 if elmt[3] is None:
 *                     target = elmt[1].bestof(elmt[2])
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L31:;

  /* "metaphor/chem_gm/core/metamolecule.py":881
 *                     pass
 * 
 *         return skeleton             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_skeleton);
  __pyx_r = __pyx_v_skeleton;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":820
 * 
 * #-------------------------------------------------------------------------------
 *     def getskeleton(self, central, coupurecycles=1): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # cration du squelette du modle a partir du jeton central
 *         # C'est une liste de listes de jetons. Les sous listes sont classes par distance croissante avec le central
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getskeleton", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dmax);
  __Pyx_XDECREF(__pyx_v_skeleton);
  __Pyx_XDECREF(__pyx_v_cycleends);
  __Pyx_XDECREF(__pyx_v_last);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_tok2);
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_tg1);
  __Pyx_XDECREF(__pyx_v_tg2);
  __Pyx_XDECREF(__pyx_v_bond1);
  __Pyx_XDECREF(__pyx_v_bond2);
  __Pyx_XDECREF(__pyx_v_elmt);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_dist);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ref);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_48generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":884
 * 
 * #-------------------------------------------------------------------------------
 *     def atomgen(self, singleton=True): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_47atomgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_47atomgen = {"atomgen", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_47atomgen, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_47atomgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_singleton = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("atomgen (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_singleton,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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_singleton);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomgen") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_singleton = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("atomgen", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.atomgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_46atomgen(__pyx_self, __pyx_v_self, __pyx_v_singleton);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_46atomgen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_singleton) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("atomgen", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 884, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_singleton = __pyx_v_singleton;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_singleton);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_singleton);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_48generator, __pyx_codeobj__20, (PyObject *) __pyx_cur_scope, __pyx_n_s_atomgen, __pyx_n_s_MetaMolecule_atomgen, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.atomgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_48generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("atomgen", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    case 2: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 884, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":886
 *     def atomgen(self, singleton=True): # MetaMolecule
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             if not singleton:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_already = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":887
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if not singleton:
 *                 yield tok.symbol
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 887, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tok);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tok, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":888
 *         already = []
 *         for tok in self.__smitokens:
 *             if not singleton:             # <<<<<<<<<<<<<<
 *                 yield tok.symbol
 *             elif (not tok.symbol in already):
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_singleton); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":889
 *         for tok in self.__smitokens:
 *             if not singleton:
 *                 yield tok.symbol             # <<<<<<<<<<<<<<
 *             elif (not tok.symbol in already):
 *                 already.append(tok.symbol)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 889, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":888
 *         already = []
 *         for tok in self.__smitokens:
 *             if not singleton:             # <<<<<<<<<<<<<<
 *                 yield tok.symbol
 *             elif (not tok.symbol in already):
 */
      goto __pyx_L6;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":890
 *             if not singleton:
 *                 yield tok.symbol
 *             elif (not tok.symbol in already):             # <<<<<<<<<<<<<<
 *                 already.append(tok.symbol)
 *                 yield tok.symbol
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_cur_scope->__pyx_v_already, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "metaphor/chem_gm/core/metamolecule.py":891
 *                 yield tok.symbol
 *             elif (not tok.symbol in already):
 *                 already.append(tok.symbol)             # <<<<<<<<<<<<<<
 *                 yield tok.symbol
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_already, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":892
 *             elif (not tok.symbol in already):
 *                 already.append(tok.symbol)
 *                 yield tok.symbol             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L8_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 892, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":890
 *             if not singleton:
 *                 yield tok.symbol
 *             elif (not tok.symbol in already):             # <<<<<<<<<<<<<<
 *                 already.append(tok.symbol)
 *                 yield tok.symbol
 */
    }
    __pyx_L6:;

    /* "metaphor/chem_gm/core/metamolecule.py":887
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if not singleton:
 *                 yield tok.symbol
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/chem_gm/core/metamolecule.py":884
 * 
 * #-------------------------------------------------------------------------------
 *     def atomgen(self, singleton=True): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 */

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

/* "metaphor/chem_gm/core/metamolecule.py":895
 * 
 * #-------------------------------------------------------------------------------
 *     def clearModelBrokens(self):             # <<<<<<<<<<<<<<
 *         self._ringmodel = 0
 *         for bond in self.bonds():
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_50clearModelBrokens(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_50clearModelBrokens = {"clearModelBrokens", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_50clearModelBrokens, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_50clearModelBrokens(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clearModelBrokens (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_49clearModelBrokens(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_49clearModelBrokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("clearModelBrokens", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":896
 * #-------------------------------------------------------------------------------
 *     def clearModelBrokens(self):
 *         self._ringmodel = 0             # <<<<<<<<<<<<<<
 *         for bond in self.bonds():
 *             bond._modelbroken = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringmodel, __pyx_int_0) < 0) __PYX_ERR(0, 896, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":897
 *     def clearModelBrokens(self):
 *         self._ringmodel = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             bond._modelbroken = 0
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 897, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 897, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 897, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":898
 *         self._ringmodel = 0
 *         for bond in self.bonds():
 *             bond._modelbroken = 0             # <<<<<<<<<<<<<<
 * 
 *     def clearbrokens(self): # MetaMolecule
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_bond, __pyx_n_s_modelbroken_2, __pyx_int_0) < 0) __PYX_ERR(0, 898, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":897
 *     def clearModelBrokens(self):
 *         self._ringmodel = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             bond._modelbroken = 0
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":895
 * 
 * #-------------------------------------------------------------------------------
 *     def clearModelBrokens(self):             # <<<<<<<<<<<<<<
 *         self._ringmodel = 0
 *         for bond in self.bonds():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.clearModelBrokens", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":900
 *             bond._modelbroken = 0
 * 
 *     def clearbrokens(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         for bond in self.bonds():
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_52clearbrokens(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_52clearbrokens = {"clearbrokens", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_52clearbrokens, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_52clearbrokens(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clearbrokens (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_51clearbrokens(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_51clearbrokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("clearbrokens", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":901
 * 
 *     def clearbrokens(self): # MetaMolecule
 *         self._ringsmiles = 0             # <<<<<<<<<<<<<<
 *         for bond in self.bonds():
 *             bond._broken = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringsmiles, __pyx_int_0) < 0) __PYX_ERR(0, 901, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":902
 *     def clearbrokens(self): # MetaMolecule
 *         self._ringsmiles = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             bond._broken = 0
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 902, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":903
 *         self._ringsmiles = 0
 *         for bond in self.bonds():
 *             bond._broken = 0             # <<<<<<<<<<<<<<
 * 
 *     def recreatebrokenbonds(self):# MetaMolecule
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_bond, __pyx_n_s_broken_2, __pyx_int_0) < 0) __PYX_ERR(0, 903, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":902
 *     def clearbrokens(self): # MetaMolecule
 *         self._ringsmiles = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             bond._broken = 0
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":900
 *             bond._modelbroken = 0
 * 
 *     def clearbrokens(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         for bond in self.bonds():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.clearbrokens", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":905
 *             bond._broken = 0
 * 
 *     def recreatebrokenbonds(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Creation of closures for Smiles
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_54recreatebrokenbonds(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_53recreatebrokenbonds[] = "Creation of closures for Smiles\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_54recreatebrokenbonds = {"recreatebrokenbonds", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_54recreatebrokenbonds, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_53recreatebrokenbonds};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_54recreatebrokenbonds(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("recreatebrokenbonds (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_53recreatebrokenbonds(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_53recreatebrokenbonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("recreatebrokenbonds", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":908
 *         """Creation of closures for Smiles
 *         """
 *         self.clearbrokens()             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         #if len(self.__smitokens):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clearbrokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":909
 *         """
 *         self.clearbrokens()
 *         self._ringsmiles = 0             # <<<<<<<<<<<<<<
 *         #if len(self.__smitokens):
 *         for tok in self.__smitokens:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ringsmiles, __pyx_int_0) < 0) __PYX_ERR(0, 909, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":911
 *         self._ringsmiles = 0
 *         #if len(self.__smitokens):
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             tok.written = False
 *         self.__smitokens[0].populatebrokenbonds(self)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 911, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 911, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 911, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":912
 *         #if len(self.__smitokens):
 *         for tok in self.__smitokens:
 *             tok.written = False             # <<<<<<<<<<<<<<
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_written, Py_False) < 0) __PYX_ERR(0, 912, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":911
 *         self._ringsmiles = 0
 *         #if len(self.__smitokens):
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             tok.written = False
 *         self.__smitokens[0].populatebrokenbonds(self)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":913
 *         for tok in self.__smitokens:
 *             tok.written = False
 *         self.__smitokens[0].populatebrokenbonds(self)             # <<<<<<<<<<<<<<
 * 
 *     def bonds(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __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_populatebrokenbonds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":905
 *             bond._broken = 0
 * 
 *     def recreatebrokenbonds(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Creation of closures for Smiles
 *         """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.recreatebrokenbonds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_57generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "metaphor/chem_gm/core/metamolecule.py":915
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 *     def bonds(self):             # <<<<<<<<<<<<<<
 *         """generator of the bonds
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_56bonds(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_55bonds[] = "generator of the bonds\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_56bonds = {"bonds", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_56bonds, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_55bonds};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_56bonds(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bonds (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_55bonds(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_55bonds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bonds", 0);
  __pyx_cur_scope = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds(__pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 915, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_57generator1, __pyx_codeobj__21, (PyObject *) __pyx_cur_scope, __pyx_n_s_bonds, __pyx_n_s_MetaMolecule_bonds, __pyx_n_s_metaphor_chem_gm_core_metamolecu); if (unlikely(!gen)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.bonds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_57generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *__pyx_cur_scope = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bonds", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 915, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":918
 *         """generator of the bonds
 *         """
 *         mem = []             # <<<<<<<<<<<<<<
 *         for tok in self:
 *             for bond in tok.cbonds:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_mem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":919
 *         """
 *         mem = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             for bond in tok.cbonds:
 *                 if not bond in mem:
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_self)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_self)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 919, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 919, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 919, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tok);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tok, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":920
 *         mem = []
 *         for tok in self:
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if not bond in mem:
 *                     mem.append(bond)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 920, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 920, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 920, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_bond);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_bond, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":921
 *         for tok in self:
 *             for bond in tok.cbonds:
 *                 if not bond in mem:             # <<<<<<<<<<<<<<
 *                     mem.append(bond)
 *                     yield bond
 */
      __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_bond, __pyx_cur_scope->__pyx_v_mem, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_8 != 0);
      if (__pyx_t_9) {

        /* "metaphor/chem_gm/core/metamolecule.py":922
 *             for bond in tok.cbonds:
 *                 if not bond in mem:
 *                     mem.append(bond)             # <<<<<<<<<<<<<<
 *                     yield bond
 * 
 */
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_mem, __pyx_cur_scope->__pyx_v_bond); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 922, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":923
 *                 if not bond in mem:
 *                     mem.append(bond)
 *                     yield bond             # <<<<<<<<<<<<<<
 * 
 *     def ringClosureMax(self):
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bond);
        __pyx_r = __pyx_cur_scope->__pyx_v_bond;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
        __Pyx_XGIVEREF(__pyx_t_5);
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_4 = __pyx_t_6;
        __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L9_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_3;
        __pyx_cur_scope->__pyx_t_3 = 0;
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_4;
        __pyx_t_7 = __pyx_cur_scope->__pyx_t_5;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 923, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":921
 *         for tok in self:
 *             for bond in tok.cbonds:
 *                 if not bond in mem:             # <<<<<<<<<<<<<<
 *                     mem.append(bond)
 *                     yield bond
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":920
 *         mem = []
 *         for tok in self:
 *             for bond in tok.cbonds:             # <<<<<<<<<<<<<<
 *                 if not bond in mem:
 *                     mem.append(bond)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":919
 *         """
 *         mem = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             for bond in tok.cbonds:
 *                 if not bond in mem:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "metaphor/chem_gm/core/metamolecule.py":915
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 *     def bonds(self):             # <<<<<<<<<<<<<<
 *         """generator of the bonds
 *         """
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bonds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":925
 *                     yield bond
 * 
 *     def ringClosureMax(self):             # <<<<<<<<<<<<<<
 *         val = 0
 *         for bond in self.bonds():
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_59ringClosureMax(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_59ringClosureMax = {"ringClosureMax", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_59ringClosureMax, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_59ringClosureMax(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ringClosureMax (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_58ringClosureMax(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_58ringClosureMax(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  long __pyx_v_val;
  PyObject *__pyx_v_bond = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  long __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("ringClosureMax", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":926
 * 
 *     def ringClosureMax(self):
 *         val = 0             # <<<<<<<<<<<<<<
 *         for bond in self.bonds():
 *             val = max(val, bond.broken)
 */
  __pyx_v_val = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":927
 *     def ringClosureMax(self):
 *         val = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             val = max(val, bond.broken)
 *         return val
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 927, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_bond, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":928
 *         val = 0
 *         for bond in self.bonds():
 *             val = max(val, bond.broken)             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bond, __pyx_n_s_broken); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __pyx_v_val;
    __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_9) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1;
    } else {
      __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __pyx_t_8;
      __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_val = __pyx_t_6;

    /* "metaphor/chem_gm/core/metamolecule.py":927
 *     def ringClosureMax(self):
 *         val = 0
 *         for bond in self.bonds():             # <<<<<<<<<<<<<<
 *             val = max(val, bond.broken)
 *         return val
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":929
 *         for bond in self.bonds():
 *             val = max(val, bond.broken)
 *         return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":925
 *                     yield bond
 * 
 *     def ringClosureMax(self):             # <<<<<<<<<<<<<<
 *         val = 0
 *         for bond in self.bonds():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.ringClosureMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bond);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":934
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmilesStart(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         #return 0
 *         for tok in self.__smitokens:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_61getSmilesStart(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_61getSmilesStart = {"getSmilesStart", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_61getSmilesStart, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_61getSmilesStart(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSmilesStart (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_60getSmilesStart(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "metaphor/chem_gm/core/metamolecule.py":942
 *         #self.computedistances(includebroken=True)
 *         dmaxlst = [(max(tok.distances), tok.numero) for tok in self.__smitokens if tok.symbol!="H"]
 *         dmmaxmax = max(dmaxlst, key=lambda x:x[0])[0]             # <<<<<<<<<<<<<<
 *         max_map = [ind for dmax, ind in dmaxlst if dmax == dmmaxmax]
 *         terminals = [self.__smitokens[ind] for ind in max_map]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_lambda11(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_lambda11 = {"lambda11", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_lambda11, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_lambda11(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda11(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda11", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getSmilesStart.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":954
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[distsum.index(distmax)]
 *         sqyaredistsum = [sum(map(lambda x:x*x, tok._distances)) for tok in terminals]             # <<<<<<<<<<<<<<
 *         # pour chaque atome, on fait la somme des carres des distanves aux autres atomes
 *         squaredistmax = max(sqyaredistsum)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_9genexpr22_lambda12(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_9genexpr22_lambda12 = {"lambda12", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_9genexpr22_lambda12, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_9genexpr22_lambda12(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda12(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lambda12", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getSmilesStart.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":934
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmilesStart(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         #return 0
 *         for tok in self.__smitokens:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_60getSmilesStart(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_dmaxlst = NULL;
  PyObject *__pyx_v_dmmaxmax = NULL;
  PyObject *__pyx_v_max_map = NULL;
  PyObject *__pyx_v_terminals = NULL;
  PyObject *__pyx_v_distsum = NULL;
  PyObject *__pyx_v_distmax = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_sqyaredistsum = NULL;
  PyObject *__pyx_v_squaredistmax = NULL;
  PyObject *__pyx_v_blst = NULL;
  PyObject *__pyx_v_singleterminals = NULL;
  PyObject *__pyx_v_aromaticterm = NULL;
  PyObject *__pyx_9genexpr18__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr19__pyx_v_dmax = NULL;
  PyObject *__pyx_9genexpr19__pyx_v_ind = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_ind = NULL;
  PyObject *__pyx_9genexpr21__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr22__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_bond = NULL;
  PyObject *__pyx_9genexpr24__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr25__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("getSmilesStart", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":936
 *     def getSmilesStart(self):# MetaMolecule
 *         #return 0
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.applidata == 9:
 *                 return tok.numero
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 936, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":937
 *         #return 0
 *         for tok in self.__smitokens:
 *             if tok.applidata == 9:             # <<<<<<<<<<<<<<
 *                 return tok.numero
 *         # calcul de l'indice de l'atome de depart du smiles
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_applidata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_9, 9, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":938
 *         for tok in self.__smitokens:
 *             if tok.applidata == 9:
 *                 return tok.numero             # <<<<<<<<<<<<<<
 *         # calcul de l'indice de l'atome de depart du smiles
 *         #self.computedistances(includebroken=True)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "metaphor/chem_gm/core/metamolecule.py":937
 *         #return 0
 *         for tok in self.__smitokens:
 *             if tok.applidata == 9:             # <<<<<<<<<<<<<<
 *                 return tok.numero
 *         # calcul de l'indice de l'atome de depart du smiles
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":936
 *     def getSmilesStart(self):# MetaMolecule
 *         #return 0
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if tok.applidata == 9:
 *                 return tok.numero
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":941
 *         # calcul de l'indice de l'atome de depart du smiles
 *         #self.computedistances(includebroken=True)
 *         dmaxlst = [(max(tok.distances), tok.numero) for tok in self.__smitokens if tok.symbol!="H"]             # <<<<<<<<<<<<<<
 *         dmmaxmax = max(dmaxlst, key=lambda x:x[0])[0]
 *         max_map = [ind for dmax, ind in dmaxlst if dmax == dmmaxmax]
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 941, __pyx_L8_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 941, __pyx_L8_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 941, __pyx_L8_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 941, __pyx_L8_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_tok, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr18__pyx_v_tok, __pyx_n_s_symbol); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_H, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 941, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr18__pyx_v_tok, __pyx_n_s_distances_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 941, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr18__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 941, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
        __pyx_t_7 = 0;
        __pyx_t_5 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 941, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_tok); __pyx_9genexpr18__pyx_v_tok = 0;
    goto __pyx_L12_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_tok); __pyx_9genexpr18__pyx_v_tok = 0;
    goto __pyx_L1_error;
    __pyx_L12_exit_scope:;
  } /* exit inner scope */
  __pyx_v_dmaxlst = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":942
 *         #self.computedistances(includebroken=True)
 *         dmaxlst = [(max(tok.distances), tok.numero) for tok in self.__smitokens if tok.symbol!="H"]
 *         dmmaxmax = max(dmaxlst, key=lambda x:x[0])[0]             # <<<<<<<<<<<<<<
 *         max_map = [ind for dmax, ind in dmaxlst if dmax == dmmaxmax]
 *         terminals = [self.__smitokens[ind] for ind in max_map]
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_dmaxlst);
  __Pyx_GIVEREF(__pyx_v_dmaxlst);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_dmaxlst);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_lambda11, 0, __pyx_n_s_MetaMolecule_getSmilesStart_loca, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __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_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_dmmaxmax = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":943
 *         dmaxlst = [(max(tok.distances), tok.numero) for tok in self.__smitokens if tok.symbol!="H"]
 *         dmmaxmax = max(dmaxlst, key=lambda x:x[0])[0]
 *         max_map = [ind for dmax, ind in dmaxlst if dmax == dmmaxmax]             # <<<<<<<<<<<<<<
 *         terminals = [self.__smitokens[ind] for ind in max_map]
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __pyx_v_dmaxlst; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= 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_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 943, __pyx_L15_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 943, __pyx_L15_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 943, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 943, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 943, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 943, __pyx_L15_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L19_unpacking_done;
        __pyx_L18_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 943, __pyx_L15_error)
        __pyx_L19_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_dmax, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_ind, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = PyObject_RichCompare(__pyx_9genexpr19__pyx_v_dmax, __pyx_v_dmmaxmax, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L15_error)
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 943, __pyx_L15_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr19__pyx_v_ind))) __PYX_ERR(0, 943, __pyx_L15_error)
      }
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_dmax); __pyx_9genexpr19__pyx_v_dmax = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_ind); __pyx_9genexpr19__pyx_v_ind = 0;
    goto __pyx_L21_exit_scope;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_dmax); __pyx_9genexpr19__pyx_v_dmax = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_ind); __pyx_9genexpr19__pyx_v_ind = 0;
    goto __pyx_L1_error;
    __pyx_L21_exit_scope:;
  } /* exit inner scope */
  __pyx_v_max_map = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":944
 *         dmmaxmax = max(dmaxlst, key=lambda x:x[0])[0]
 *         max_map = [ind for dmax, ind in dmaxlst if dmax == dmmaxmax]
 *         terminals = [self.__smitokens[ind] for ind in max_map]             # <<<<<<<<<<<<<<
 * 
 *         distsum = [sum(tok._distances) for tok in terminals]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L24_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __pyx_v_max_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= 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_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 944, __pyx_L24_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_ind, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_9genexpr20__pyx_v_ind); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 944, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 944, __pyx_L24_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_ind); __pyx_9genexpr20__pyx_v_ind = 0;
    goto __pyx_L27_exit_scope;
    __pyx_L24_error:;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_ind); __pyx_9genexpr20__pyx_v_ind = 0;
    goto __pyx_L1_error;
    __pyx_L27_exit_scope:;
  } /* exit inner scope */
  __pyx_v_terminals = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":946
 *         terminals = [self.__smitokens[ind] for ind in max_map]
 * 
 *         distsum = [sum(tok._distances) for tok in terminals]             # <<<<<<<<<<<<<<
 *         # pour chaque atome, on fait la somme des distanves aux autres atomes
 *         distmax = max(distsum)
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L30_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_terminals)) || PyTuple_CheckExact(__pyx_v_terminals)) {
      __pyx_t_8 = __pyx_v_terminals; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_terminals); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 946, __pyx_L30_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L30_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 946, __pyx_L30_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 946, __pyx_L30_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_4(__pyx_t_8);
        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, 946, __pyx_L30_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_tok, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr21__pyx_v_tok, __pyx_n_s_distances); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L30_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L30_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 946, __pyx_L30_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_tok); __pyx_9genexpr21__pyx_v_tok = 0;
    goto __pyx_L33_exit_scope;
    __pyx_L30_error:;
    __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_tok); __pyx_9genexpr21__pyx_v_tok = 0;
    goto __pyx_L1_error;
    __pyx_L33_exit_scope:;
  } /* exit inner scope */
  __pyx_v_distsum = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":948
 *         distsum = [sum(tok._distances) for tok in terminals]
 *         # pour chaque atome, on fait la somme des distanves aux autres atomes
 *         distmax = max(distsum)             # <<<<<<<<<<<<<<
 *         n = distsum.count(distmax)
 *         # on cherche le nombre d'occurences du maximum de distance
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_distsum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_distmax = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":949
 *         # pour chaque atome, on fait la somme des distanves aux autres atomes
 *         distmax = max(distsum)
 *         n = distsum.count(distmax)             # <<<<<<<<<<<<<<
 *         # on cherche le nombre d'occurences du maximum de distance
 *         if n == 1:
 */
  __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_count, __pyx_v_distsum, __pyx_v_distmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":951
 *         n = distsum.count(distmax)
 *         # on cherche le nombre d'occurences du maximum de distance
 *         if n == 1:             # <<<<<<<<<<<<<<
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[distsum.index(distmax)]
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":953
 *         if n == 1:
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[distsum.index(distmax)]             # <<<<<<<<<<<<<<
 *         sqyaredistsum = [sum(map(lambda x:x*x, tok._distances)) for tok in terminals]
 *         # pour chaque atome, on fait la somme des carres des distanves aux autres atomes
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_distsum, __pyx_v_distmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_max_map, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":951
 *         n = distsum.count(distmax)
 *         # on cherche le nombre d'occurences du maximum de distance
 *         if n == 1:             # <<<<<<<<<<<<<<
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[distsum.index(distmax)]
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":954
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[distsum.index(distmax)]
 *         sqyaredistsum = [sum(map(lambda x:x*x, tok._distances)) for tok in terminals]             # <<<<<<<<<<<<<<
 *         # pour chaque atome, on fait la somme des carres des distanves aux autres atomes
 *         squaredistmax = max(sqyaredistsum)
 */
  { /* enter inner scope */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 954, __pyx_L37_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(PyList_CheckExact(__pyx_v_terminals)) || PyTuple_CheckExact(__pyx_v_terminals)) {
      __pyx_t_1 = __pyx_v_terminals; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_terminals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L37_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 954, __pyx_L37_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 954, __pyx_L37_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 954, __pyx_L37_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_tok, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_14getSmilesStart_9genexpr22_lambda12, 0, __pyx_n_s_MetaMolecule_getSmilesStart_loca, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr22__pyx_v_tok, __pyx_n_s_distances); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
      __pyx_t_2 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 954, __pyx_L37_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_tok); __pyx_9genexpr22__pyx_v_tok = 0;
    goto __pyx_L40_exit_scope;
    __pyx_L37_error:;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_tok); __pyx_9genexpr22__pyx_v_tok = 0;
    goto __pyx_L1_error;
    __pyx_L40_exit_scope:;
  } /* exit inner scope */
  __pyx_v_sqyaredistsum = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":956
 *         sqyaredistsum = [sum(map(lambda x:x*x, tok._distances)) for tok in terminals]
 *         # pour chaque atome, on fait la somme des carres des distanves aux autres atomes
 *         squaredistmax = max(sqyaredistsum)             # <<<<<<<<<<<<<<
 *         n = sqyaredistsum.count(squaredistmax)
 *         # on cherche le nombre d'occurences du maximum des carres des distancec
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_sqyaredistsum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_squaredistmax = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":957
 *         # pour chaque atome, on fait la somme des carres des distanves aux autres atomes
 *         squaredistmax = max(sqyaredistsum)
 *         n = sqyaredistsum.count(squaredistmax)             # <<<<<<<<<<<<<<
 *         # on cherche le nombre d'occurences du maximum des carres des distancec
 *         if n == 1:
 */
  __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_count, __pyx_v_sqyaredistsum, __pyx_v_squaredistmax); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":959
 *         n = sqyaredistsum.count(squaredistmax)
 *         # on cherche le nombre d'occurences du maximum des carres des distancec
 *         if n == 1:             # <<<<<<<<<<<<<<
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[sqyaredistsum.index(squaredistmax)]
 */
  __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":961
 *         if n == 1:
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[sqyaredistsum.index(squaredistmax)]             # <<<<<<<<<<<<<<
 * 
 *         #terminals = [tok for tok, dmax in zip(self.__smitokens, sqyaredistsum) if dmax == squaredistmax]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_sqyaredistsum, __pyx_v_squaredistmax); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_max_map, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":959
 *         n = sqyaredistsum.count(squaredistmax)
 *         # on cherche le nombre d'occurences du maximum des carres des distancec
 *         if n == 1:             # <<<<<<<<<<<<<<
 *             # s'il n'y en a qu'un, on retourne son indice
 *             return max_map[sqyaredistsum.index(squaredistmax)]
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":964
 * 
 *         #terminals = [tok for tok, dmax in zip(self.__smitokens, sqyaredistsum) if dmax == squaredistmax]
 *         if not len(terminals):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_terminals); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 964, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":965
 *         #terminals = [tok for tok, dmax in zip(self.__smitokens, sqyaredistsum) if dmax == squaredistmax]
 *         if not len(terminals):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 *                 if len(blst) == 1:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 965, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 965, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_4(__pyx_t_8);
        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, 965, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":966
 *         if not len(terminals):
 *             for tok in self.__smitokens:
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]             # <<<<<<<<<<<<<<
 *                 if len(blst) == 1:
 *                     terminals.append(tok)
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
        } else {
          __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 966, __pyx_L47_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_12)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 966, __pyx_L47_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 966, __pyx_L47_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_12(__pyx_t_7);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 966, __pyx_L47_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_bond, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr23__pyx_v_bond, __pyx_n_s_linkedto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_9) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_tok); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
            __Pyx_GOTREF(__pyx_t_5);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_2)) {
              PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_tok};
              __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
              PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_tok};
              __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL;
              __Pyx_INCREF(__pyx_v_tok);
              __Pyx_GIVEREF(__pyx_v_tok);
              PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_tok);
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L47_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_H, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 966, __pyx_L47_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_6) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr23__pyx_v_bond))) __PYX_ERR(0, 966, __pyx_L47_error)
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_bond); __pyx_9genexpr23__pyx_v_bond = 0;
        goto __pyx_L51_exit_scope;
        __pyx_L47_error:;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_bond); __pyx_9genexpr23__pyx_v_bond = 0;
        goto __pyx_L1_error;
        __pyx_L51_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_blst, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":967
 *             for tok in self.__smitokens:
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 *                 if len(blst) == 1:             # <<<<<<<<<<<<<<
 *                     terminals.append(tok)
 *         if len(terminals):
 */
      __pyx_t_11 = PyList_GET_SIZE(__pyx_v_blst); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 967, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_11 == 1) != 0);
      if (__pyx_t_6) {

        /* "metaphor/chem_gm/core/metamolecule.py":968
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 *                 if len(blst) == 1:
 *                     terminals.append(tok)             # <<<<<<<<<<<<<<
 *         if len(terminals):
 *             singleterminals = [tok for tok in terminals if tok.cbonds[0].bondType==SINGLE_BOND]
 */
        __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_terminals, __pyx_v_tok); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 968, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":967
 *             for tok in self.__smitokens:
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 *                 if len(blst) == 1:             # <<<<<<<<<<<<<<
 *                     terminals.append(tok)
 *         if len(terminals):
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":965
 *         #terminals = [tok for tok, dmax in zip(self.__smitokens, sqyaredistsum) if dmax == squaredistmax]
 *         if not len(terminals):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 *                 if len(blst) == 1:
 */
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":964
 * 
 *         #terminals = [tok for tok, dmax in zip(self.__smitokens, sqyaredistsum) if dmax == squaredistmax]
 *         if not len(terminals):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 blst = [bond for bond in tok.cbonds if bond.linkedto(tok).symbol != "H"]
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":969
 *                 if len(blst) == 1:
 *                     terminals.append(tok)
 *         if len(terminals):             # <<<<<<<<<<<<<<
 *             singleterminals = [tok for tok in terminals if tok.cbonds[0].bondType==SINGLE_BOND]
 * #             singleterminals = []
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_terminals); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 969, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (__pyx_t_6) {

    /* "metaphor/chem_gm/core/metamolecule.py":970
 *                     terminals.append(tok)
 *         if len(terminals):
 *             singleterminals = [tok for tok in terminals if tok.cbonds[0].bondType==SINGLE_BOND]             # <<<<<<<<<<<<<<
 * #             singleterminals = []
 * #             for tok in terminals:
 */
    { /* enter inner scope */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 970, __pyx_L56_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (likely(PyList_CheckExact(__pyx_v_terminals)) || PyTuple_CheckExact(__pyx_v_terminals)) {
        __pyx_t_1 = __pyx_v_terminals; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
        __pyx_t_4 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_terminals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L56_error)
      }
      for (;;) {
        if (likely(!__pyx_t_4)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 970, __pyx_L56_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L56_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 970, __pyx_L56_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L56_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_4(__pyx_t_1);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 970, __pyx_L56_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_tok, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr24__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bondType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 970, __pyx_L56_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_6) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_9genexpr24__pyx_v_tok))) __PYX_ERR(0, 970, __pyx_L56_error)
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_tok); __pyx_9genexpr24__pyx_v_tok = 0;
      goto __pyx_L60_exit_scope;
      __pyx_L56_error:;
      __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_tok); __pyx_9genexpr24__pyx_v_tok = 0;
      goto __pyx_L1_error;
      __pyx_L60_exit_scope:;
    } /* exit inner scope */
    __pyx_v_singleterminals = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":975
 * #                 if tok.cbonds[0].bondType==SINGLE_BOND:
 * #                     singleterminals.append(tok)
 *             if len(singleterminals):             # <<<<<<<<<<<<<<
 *                 terminals = singleterminals
 *             else:
 */
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_singleterminals); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 975, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":976
 * #                     singleterminals.append(tok)
 *             if len(singleterminals):
 *                 terminals = singleterminals             # <<<<<<<<<<<<<<
 *             else:
 *                 aromaticterm = [tok for tok in terminals if tok.cbonds[0].bondType==AROMATIC_BOND]
 */
      __Pyx_INCREF(__pyx_v_singleterminals);
      __Pyx_DECREF_SET(__pyx_v_terminals, __pyx_v_singleterminals);

      /* "metaphor/chem_gm/core/metamolecule.py":975
 * #                 if tok.cbonds[0].bondType==SINGLE_BOND:
 * #                     singleterminals.append(tok)
 *             if len(singleterminals):             # <<<<<<<<<<<<<<
 *                 terminals = singleterminals
 *             else:
 */
      goto __pyx_L61;
    }

    /* "metaphor/chem_gm/core/metamolecule.py":978
 *                 terminals = singleterminals
 *             else:
 *                 aromaticterm = [tok for tok in terminals if tok.cbonds[0].bondType==AROMATIC_BOND]             # <<<<<<<<<<<<<<
 *                 if len(aromaticterm):
 *                     terminals = aromaticterm
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 978, __pyx_L64_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (likely(PyList_CheckExact(__pyx_v_terminals)) || PyTuple_CheckExact(__pyx_v_terminals)) {
          __pyx_t_1 = __pyx_v_terminals; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
          __pyx_t_4 = NULL;
        } else {
          __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_terminals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L64_error)
        }
        for (;;) {
          if (likely(!__pyx_t_4)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 978, __pyx_L64_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L64_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 978, __pyx_L64_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L64_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_4(__pyx_t_1);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 978, __pyx_L64_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_tok, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr25__pyx_v_tok, __pyx_n_s_cbonds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bondType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AROMATIC_BOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 978, __pyx_L64_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (__pyx_t_6) {
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_9genexpr25__pyx_v_tok))) __PYX_ERR(0, 978, __pyx_L64_error)
          }
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_tok); __pyx_9genexpr25__pyx_v_tok = 0;
        goto __pyx_L68_exit_scope;
        __pyx_L64_error:;
        __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_tok); __pyx_9genexpr25__pyx_v_tok = 0;
        goto __pyx_L1_error;
        __pyx_L68_exit_scope:;
      } /* exit inner scope */
      __pyx_v_aromaticterm = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":979
 *             else:
 *                 aromaticterm = [tok for tok in terminals if tok.cbonds[0].bondType==AROMATIC_BOND]
 *                 if len(aromaticterm):             # <<<<<<<<<<<<<<
 *                     terminals = aromaticterm
 *         else:
 */
      __pyx_t_3 = PyList_GET_SIZE(__pyx_v_aromaticterm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 979, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_3 != 0);
      if (__pyx_t_6) {

        /* "metaphor/chem_gm/core/metamolecule.py":980
 *                 aromaticterm = [tok for tok in terminals if tok.cbonds[0].bondType==AROMATIC_BOND]
 *                 if len(aromaticterm):
 *                     terminals = aromaticterm             # <<<<<<<<<<<<<<
 *         else:
 *             terminals = self.__smitokens[:]
 */
        __Pyx_INCREF(__pyx_v_aromaticterm);
        __Pyx_DECREF_SET(__pyx_v_terminals, __pyx_v_aromaticterm);

        /* "metaphor/chem_gm/core/metamolecule.py":979
 *             else:
 *                 aromaticterm = [tok for tok in terminals if tok.cbonds[0].bondType==AROMATIC_BOND]
 *                 if len(aromaticterm):             # <<<<<<<<<<<<<<
 *                     terminals = aromaticterm
 *         else:
 */
      }
    }
    __pyx_L61:;

    /* "metaphor/chem_gm/core/metamolecule.py":969
 *                 if len(blst) == 1:
 *                     terminals.append(tok)
 *         if len(terminals):             # <<<<<<<<<<<<<<
 *             singleterminals = [tok for tok in terminals if tok.cbonds[0].bondType==SINGLE_BOND]
 * #             singleterminals = []
 */
    goto __pyx_L53;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":982
 *                     terminals = aromaticterm
 *         else:
 *             terminals = self.__smitokens[:]             # <<<<<<<<<<<<<<
 *         terminals = sorted(terminals, key = keyForChiral)
 * 
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__22, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_terminals, __pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L53:;

  /* "metaphor/chem_gm/core/metamolecule.py":983
 *         else:
 *             terminals = self.__smitokens[:]
 *         terminals = sorted(terminals, key = keyForChiral)             # <<<<<<<<<<<<<<
 * 
 * #         nonC = [tok for tok in terminals if tok.symbol != "C"]
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_terminals);
  __Pyx_GIVEREF(__pyx_v_terminals);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_terminals);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_keyForChiral); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_key, __pyx_t_7) < 0) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_terminals, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":989
 * #             terminals = nonC
 * #         #singles = [tok for tok in terminals if ]
 *         return terminals[0].numero             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_terminals, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_numero); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":934
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmilesStart(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         #return 0
 *         for tok in self.__smitokens:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getSmilesStart", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_dmaxlst);
  __Pyx_XDECREF(__pyx_v_dmmaxmax);
  __Pyx_XDECREF(__pyx_v_max_map);
  __Pyx_XDECREF(__pyx_v_terminals);
  __Pyx_XDECREF(__pyx_v_distsum);
  __Pyx_XDECREF(__pyx_v_distmax);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_sqyaredistsum);
  __Pyx_XDECREF(__pyx_v_squaredistmax);
  __Pyx_XDECREF(__pyx_v_blst);
  __Pyx_XDECREF(__pyx_v_singleterminals);
  __Pyx_XDECREF(__pyx_v_aromaticterm);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_dmax);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_ind);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_ind);
  __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_bond);
  __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_tok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":992
 * 
 * #-------------------------------------------------------------------------------
 *     def getEquivalents(self, target):# MetaMolecule             # <<<<<<<<<<<<<<
 *         outstyle = 0
 *         if isinstance(target, int):
 */

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

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_62getEquivalents(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target) {
  long __pyx_v_outstyle;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_9genexpr26__pyx_v_tok = NULL;
  PyObject *__pyx_9genexpr27__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("getEquivalents", 0);
  __Pyx_INCREF(__pyx_v_target);

  /* "metaphor/chem_gm/core/metamolecule.py":993
 * #-------------------------------------------------------------------------------
 *     def getEquivalents(self, target):# MetaMolecule
 *         outstyle = 0             # <<<<<<<<<<<<<<
 *         if isinstance(target, int):
 *             target = self.__smitokens[target]
 */
  __pyx_v_outstyle = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":994
 *     def getEquivalents(self, target):# MetaMolecule
 *         outstyle = 0
 *         if isinstance(target, int):             # <<<<<<<<<<<<<<
 *             target = self.__smitokens[target]
 *             outstyle = 1
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_target); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":995
 *         outstyle = 0
 *         if isinstance(target, int):
 *             target = self.__smitokens[target]             # <<<<<<<<<<<<<<
 *             outstyle = 1
 *         #res = []
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":996
 *         if isinstance(target, int):
 *             target = self.__smitokens[target]
 *             outstyle = 1             # <<<<<<<<<<<<<<
 *         #res = []
 *         #if not target in self.__smitokens:
 */
    __pyx_v_outstyle = 1;

    /* "metaphor/chem_gm/core/metamolecule.py":994
 *     def getEquivalents(self, target):# MetaMolecule
 *         outstyle = 0
 *         if isinstance(target, int):             # <<<<<<<<<<<<<<
 *             target = self.__smitokens[target]
 *             outstyle = 1
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1000
 *         #if not target in self.__smitokens:
 *         #    return res
 *         res = [tok for tok in self.__smitokens if (tok!=target) and target.equivalent(tok)]             # <<<<<<<<<<<<<<
 *         if outstyle:
 *             res = [tok.numero for tok in res]
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1000, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_5 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __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, 1000, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1000, __pyx_L6_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1000, __pyx_L6_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        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, 1000, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_tok, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_RichCompare(__pyx_9genexpr26__pyx_v_tok, __pyx_v_target, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1000, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_equivalent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1000, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_9genexpr26__pyx_v_tok); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_9genexpr26__pyx_v_tok};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_9, __pyx_9genexpr26__pyx_v_tok};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
          __Pyx_INCREF(__pyx_9genexpr26__pyx_v_tok);
          __Pyx_GIVEREF(__pyx_9genexpr26__pyx_v_tok);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_9genexpr26__pyx_v_tok);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1000, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_2) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr26__pyx_v_tok))) __PYX_ERR(0, 1000, __pyx_L6_error)
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_tok); __pyx_9genexpr26__pyx_v_tok = 0;
    goto __pyx_L12_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_tok); __pyx_9genexpr26__pyx_v_tok = 0;
    goto __pyx_L1_error;
    __pyx_L12_exit_scope:;
  } /* exit inner scope */
  __pyx_v_res = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1001
 *         #    return res
 *         res = [tok for tok in self.__smitokens if (tok!=target) and target.equivalent(tok)]
 *         if outstyle:             # <<<<<<<<<<<<<<
 *             res = [tok.numero for tok in res]
 *         return res
 */
  __pyx_t_2 = (__pyx_v_outstyle != 0);
  if (__pyx_t_2) {

    /* "metaphor/chem_gm/core/metamolecule.py":1002
 *         res = [tok for tok in self.__smitokens if (tok!=target) and target.equivalent(tok)]
 *         if outstyle:
 *             res = [tok.numero for tok in res]             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_v_res; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      for (;;) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1002, __pyx_L16_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_tok, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr27__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1002, __pyx_L16_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_tok); __pyx_9genexpr27__pyx_v_tok = 0;
      goto __pyx_L19_exit_scope;
      __pyx_L16_error:;
      __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_tok); __pyx_9genexpr27__pyx_v_tok = 0;
      goto __pyx_L1_error;
      __pyx_L19_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_res, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1001
 *         #    return res
 *         res = [tok for tok in self.__smitokens if (tok!=target) and target.equivalent(tok)]
 *         if outstyle:             # <<<<<<<<<<<<<<
 *             res = [tok.numero for tok in res]
 *         return res
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1003
 *         if outstyle:
 *             res = [tok.numero for tok in res]
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def equivalentList(self, indexOnly=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":992
 * 
 * #-------------------------------------------------------------------------------
 *     def getEquivalents(self, target):# MetaMolecule             # <<<<<<<<<<<<<<
 *         outstyle = 0
 *         if isinstance(target, int):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getEquivalents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_tok);
  __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1005
 *         return res
 * 
 *     def equivalentList(self, indexOnly=True):             # <<<<<<<<<<<<<<
 *         """return a list of lists.
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_65equivalentList(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_64equivalentList[] = "return a list of lists.\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_65equivalentList = {"equivalentList", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_65equivalentList, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_64equivalentList};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_65equivalentList(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_indexOnly = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equivalentList (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_indexOnly,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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_indexOnly);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalentList") < 0)) __PYX_ERR(0, 1005, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_indexOnly = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equivalentList", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1005, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.equivalentList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_64equivalentList(__pyx_self, __pyx_v_self, __pyx_v_indexOnly);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_64equivalentList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_indexOnly) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_counted = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_9genexpr28__pyx_v_tok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("equivalentList", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1008
 *         """return a list of lists.
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         counted = []
 *         for tok in self:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1009
 *         """
 *         res = []
 *         counted = []             # <<<<<<<<<<<<<<
 *         for tok in self:
 *             if tok in counted:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_counted = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1010
 *         res = []
 *         counted = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             if tok in counted:
 *                 continue
 */
  if (likely(PyList_CheckExact(__pyx_v_self)) || PyTuple_CheckExact(__pyx_v_self)) {
    __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1010, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1011
 *         counted = []
 *         for tok in self:
 *             if tok in counted:             # <<<<<<<<<<<<<<
 *                 continue
 *             lst = self.getEquivalents(tok)
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_tok, __pyx_v_counted, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":1012
 *         for tok in self:
 *             if tok in counted:
 *                 continue             # <<<<<<<<<<<<<<
 *             lst = self.getEquivalents(tok)
 *             lst = [tok] + lst
 */
      goto __pyx_L3_continue;

      /* "metaphor/chem_gm/core/metamolecule.py":1011
 *         counted = []
 *         for tok in self:
 *             if tok in counted:             # <<<<<<<<<<<<<<
 *                 continue
 *             lst = self.getEquivalents(tok)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":1013
 *             if tok in counted:
 *                 continue
 *             lst = self.getEquivalents(tok)             # <<<<<<<<<<<<<<
 *             lst = [tok] + lst
 *             counted.extend(lst)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getEquivalents); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_tok); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_tok};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_tok};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1013, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_tok);
        __Pyx_GIVEREF(__pyx_v_tok);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_tok);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_lst, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1014
 *                 continue
 *             lst = self.getEquivalents(tok)
 *             lst = [tok] + lst             # <<<<<<<<<<<<<<
 *             counted.extend(lst)
 *             if indexOnly:
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_tok);
    __Pyx_GIVEREF(__pyx_v_tok);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_tok);
    __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_v_lst); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1015
 *             lst = self.getEquivalents(tok)
 *             lst = [tok] + lst
 *             counted.extend(lst)             # <<<<<<<<<<<<<<
 *             if indexOnly:
 *                 lst = [tok.numero for tok in lst]
 */
    __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_counted, __pyx_v_lst); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1015, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":1016
 *             lst = [tok] + lst
 *             counted.extend(lst)
 *             if indexOnly:             # <<<<<<<<<<<<<<
 *                 lst = [tok.numero for tok in lst]
 *             res.append(lst)
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_indexOnly); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":1017
 *             counted.extend(lst)
 *             if indexOnly:
 *                 lst = [tok.numero for tok in lst]             # <<<<<<<<<<<<<<
 *             res.append(lst)
 *         return res
 */
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
          __pyx_t_4 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
        } else {
          __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1017, __pyx_L9_error)
        }
        for (;;) {
          if (likely(!__pyx_t_12)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_9); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1017, __pyx_L9_error)
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_9);
              #endif
            } else {
              if (__pyx_t_11 >= 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_11); __Pyx_INCREF(__pyx_t_9); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1017, __pyx_L9_error)
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_9);
              #endif
            }
          } else {
            __pyx_t_9 = __pyx_t_12(__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, 1017, __pyx_L9_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_tok, __pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr28__pyx_v_tok, __pyx_n_s_numero); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1017, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_tok); __pyx_9genexpr28__pyx_v_tok = 0;
        goto __pyx_L12_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_tok); __pyx_9genexpr28__pyx_v_tok = 0;
        goto __pyx_L1_error;
        __pyx_L12_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_lst, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1016
 *             lst = [tok] + lst
 *             counted.extend(lst)
 *             if indexOnly:             # <<<<<<<<<<<<<<
 *                 lst = [tok.numero for tok in lst]
 *             res.append(lst)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":1018
 *             if indexOnly:
 *                 lst = [tok.numero for tok in lst]
 *             res.append(lst)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_lst); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1018, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":1010
 *         res = []
 *         counted = []
 *         for tok in self:             # <<<<<<<<<<<<<<
 *             if tok in counted:
 *                 continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1019
 *                 lst = [tok.numero for tok in lst]
 *             res.append(lst)
 *         return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":1005
 *         return res
 * 
 *     def equivalentList(self, indexOnly=True):             # <<<<<<<<<<<<<<
 *         """return a list of lists.
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.equivalentList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_counted);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_tok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1023
 * 
 * #-------------------------------------------------------------------------------
 *     def getReducedList(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Get the list of tokens excluding the equivalent tokens
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_67getReducedList(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_66getReducedList[] = "Get the list of tokens excluding the equivalent tokens\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_67getReducedList = {"getReducedList", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_67getReducedList, METH_O, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_66getReducedList};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_67getReducedList(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getReducedList (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_66getReducedList(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_66getReducedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_excluded = NULL;
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_equiv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("getReducedList", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1026
 *         """Get the list of tokens excluding the equivalent tokens
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         excluded = []
 *         for tok in self.__smitokens:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1027
 *         """
 *         res = []
 *         excluded = []             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             if not tok in excluded:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_excluded = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1028
 *         res = []
 *         excluded = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if not tok in excluded:
 *                 res.append(tok)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1028, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1029
 *         excluded = []
 *         for tok in self.__smitokens:
 *             if not tok in excluded:             # <<<<<<<<<<<<<<
 *                 res.append(tok)
 *                 equiv = self.getEquivalents(tok)
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_tok, __pyx_v_excluded, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "metaphor/chem_gm/core/metamolecule.py":1030
 *         for tok in self.__smitokens:
 *             if not tok in excluded:
 *                 res.append(tok)             # <<<<<<<<<<<<<<
 *                 equiv = self.getEquivalents(tok)
 *                 excluded.extend(equiv)
 */
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_tok); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1030, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":1031
 *             if not tok in excluded:
 *                 res.append(tok)
 *                 equiv = self.getEquivalents(tok)             # <<<<<<<<<<<<<<
 *                 excluded.extend(equiv)
 *         return res
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getEquivalents); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_tok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_tok};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_tok};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1031, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
          __Pyx_INCREF(__pyx_v_tok);
          __Pyx_GIVEREF(__pyx_v_tok);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_tok);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_equiv, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1032
 *                 res.append(tok)
 *                 equiv = self.getEquivalents(tok)
 *                 excluded.extend(equiv)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_excluded, __pyx_v_equiv); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1032, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":1029
 *         excluded = []
 *         for tok in self.__smitokens:
 *             if not tok in excluded:             # <<<<<<<<<<<<<<
 *                 res.append(tok)
 *                 equiv = self.getEquivalents(tok)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":1028
 *         res = []
 *         excluded = []
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             if not tok in excluded:
 *                 res.append(tok)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1033
 *                 equiv = self.getEquivalents(tok)
 *                 excluded.extend(equiv)
 *         return res             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":1023
 * 
 * #-------------------------------------------------------------------------------
 *     def getReducedList(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Get the list of tokens excluding the equivalent tokens
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getReducedList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_excluded);
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_equiv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1036
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmiles(self, isomeric=False, withIndList=False, withname=False, fullH=False, itermax=0, special=[]):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generate a SMILES of the molecule
 *         Inputs:
 */

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_20__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __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(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False));
  __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_defaults4, __pyx_self)->__pyx_arg_special);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_special);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_special);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __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.metamolecule.__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_12metamolecule_12MetaMolecule_69getSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_68getSmiles[] = "Generate a SMILES of the molecule\n        Inputs:\n        \n         - isomeric -> unused\n         - withIndList -> add the original atom index list to the result\n         - withname -> add the molecule name before the result\n         - fullH -> unused\n         - itermax -> maximum number of iterations\n         - special -> list of tuples of the format (index, speciality) where index is the atom index, and speciality is the special value to add to the atom.\n        \n        output -> [molecule name] SMILES [index list]\n        ";
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_69getSmiles = {"getSmiles", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_69getSmiles, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_68getSmiles};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_69getSmiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_isomeric = 0;
  PyObject *__pyx_v_withIndList = 0;
  PyObject *__pyx_v_withname = 0;
  PyObject *__pyx_v_fullH = 0;
  PyObject *__pyx_v_itermax = 0;
  PyObject *__pyx_v_special = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSmiles (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_isomeric,&__pyx_n_s_withIndList,&__pyx_n_s_withname,&__pyx_n_s_fullH,&__pyx_n_s_itermax,&__pyx_n_s_special,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)Py_False));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_0));
    values[6] = __pyx_dynamic_args->__pyx_arg_special;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (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_isomeric);
          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_withIndList);
          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_withname);
          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_fullH);
          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_itermax);
          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_special);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSmiles") < 0)) __PYX_ERR(0, 1036, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_isomeric = values[1];
    __pyx_v_withIndList = values[2];
    __pyx_v_withname = values[3];
    __pyx_v_fullH = values[4];
    __pyx_v_itermax = values[5];
    __pyx_v_special = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSmiles", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1036, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_68getSmiles(__pyx_self, __pyx_v_self, __pyx_v_isomeric, __pyx_v_withIndList, __pyx_v_withname, __pyx_v_fullH, __pyx_v_itermax, __pyx_v_special);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_68getSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isomeric, PyObject *__pyx_v_withIndList, PyObject *__pyx_v_withname, PyObject *__pyx_v_fullH, PyObject *__pyx_v_itermax, PyObject *__pyx_v_special) {
  PyObject *__pyx_v_tok = NULL;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_level = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_indList = NULL;
  PyObject *__pyx_v_startindex = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_cumul = NULL;
  PyObject *__pyx_v_moltest = NULL;
  PyObject *__pyx_v_datatest = NULL;
  PyObject *__pyx_v_indListTest = NULL;
  PyObject *__pyx_v_indListmem = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("getSmiles", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1049
 *         output -> [molecule name] SMILES [index list]
 *         """
 *         self.computedistances(includebroken=True)             # <<<<<<<<<<<<<<
 *         self.recreatebrokenbonds()
 *         for tok in self.__smitokens:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_computedistances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_includebroken, Py_True) < 0) __PYX_ERR(0, 1049, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1050
 *         """
 *         self.computedistances(includebroken=True)
 *         self.recreatebrokenbonds()             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             tok._special = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recreatebrokenbonds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1051
 *         self.computedistances(includebroken=True)
 *         self.recreatebrokenbonds()
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             tok._special = 0
 *         for tok in self.__smitokens:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1051, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1051, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__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, 1051, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1052
 *         self.recreatebrokenbonds()
 *         for tok in self.__smitokens:
 *             tok._special = 0             # <<<<<<<<<<<<<<
 *         for tok in self.__smitokens:
 *             for (ind, level)  in special:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_special_2, __pyx_int_0) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":1051
 *         self.computedistances(includebroken=True)
 *         self.recreatebrokenbonds()
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             tok._special = 0
 *         for tok in self.__smitokens:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1053
 *         for tok in self.__smitokens:
 *             tok._special = 0
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             for (ind, level)  in special:
 *                 if tok._numero == ind:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__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, 1053, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1054
 *             tok._special = 0
 *         for tok in self.__smitokens:
 *             for (ind, level)  in special:             # <<<<<<<<<<<<<<
 *                 if tok._numero == ind:
 *                     tok._special = level
 */
    if (likely(PyList_CheckExact(__pyx_v_special)) || PyTuple_CheckExact(__pyx_v_special)) {
      __pyx_t_2 = __pyx_v_special; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_special); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __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, 1054, __pyx_L1_error)
    }
    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, 1054, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1054, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1054, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1054, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L10_unpacking_done;
        __pyx_L9_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1054, __pyx_L1_error)
        __pyx_L10_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_level, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1055
 *         for tok in self.__smitokens:
 *             for (ind, level)  in special:
 *                 if tok._numero == ind:             # <<<<<<<<<<<<<<
 *                     tok._special = level
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tok, __pyx_n_s_numero_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_v_ind, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1055, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_12) {

        /* "metaphor/chem_gm/core/metamolecule.py":1056
 *             for (ind, level)  in special:
 *                 if tok._numero == ind:
 *                     tok._special = level             # <<<<<<<<<<<<<<
 * 
 *         data = ""
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_special_2, __pyx_v_level) < 0) __PYX_ERR(0, 1056, __pyx_L1_error)

        /* "metaphor/chem_gm/core/metamolecule.py":1055
 *         for tok in self.__smitokens:
 *             for (ind, level)  in special:
 *                 if tok._numero == ind:             # <<<<<<<<<<<<<<
 *                     tok._special = level
 * 
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":1054
 *             tok._special = 0
 *         for tok in self.__smitokens:
 *             for (ind, level)  in special:             # <<<<<<<<<<<<<<
 *                 if tok._numero == ind:
 *                     tok._special = level
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1053
 *         for tok in self.__smitokens:
 *             tok._special = 0
 *         for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *             for (ind, level)  in special:
 *                 if tok._numero == ind:
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1058
 *                     tok._special = level
 * 
 *         data = ""             # <<<<<<<<<<<<<<
 *         indList = []
 *         if len(self.__smitokens):
 */
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_v_data = __pyx_kp_u_;

  /* "metaphor/chem_gm/core/metamolecule.py":1059
 * 
 *         data = ""
 *         indList = []             # <<<<<<<<<<<<<<
 *         if len(self.__smitokens):
 *             for tok in self.__smitokens:
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_indList = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1060
 *         data = ""
 *         indList = []
 *         if len(self.__smitokens):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 tok.written = False
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = (__pyx_t_4 != 0);
  if (__pyx_t_12) {

    /* "metaphor/chem_gm/core/metamolecule.py":1061
 *         indList = []
 *         if len(self.__smitokens):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 tok.written = False
 *             startindex = self.getSmilesStart()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    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_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__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, 1061, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_tok, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1062
 *         if len(self.__smitokens):
 *             for tok in self.__smitokens:
 *                 tok.written = False             # <<<<<<<<<<<<<<
 *             startindex = self.getSmilesStart()
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_tok, __pyx_n_s_written, Py_False) < 0) __PYX_ERR(0, 1062, __pyx_L1_error)

      /* "metaphor/chem_gm/core/metamolecule.py":1061
 *         indList = []
 *         if len(self.__smitokens):
 *             for tok in self.__smitokens:             # <<<<<<<<<<<<<<
 *                 tok.written = False
 *             startindex = self.getSmilesStart()
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1063
 *             for tok in self.__smitokens:
 *                 tok.written = False
 *             startindex = self.getSmilesStart()             # <<<<<<<<<<<<<<
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)
 *             if itermax:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSmilesStart); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_9) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_startindex = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1064
 *                 tok.written = False
 *             startindex = self.getSmilesStart()
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)             # <<<<<<<<<<<<<<
 *             if itermax:
 *                 cumul = 0
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MetaMolecule__smitokens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_startindex); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
    __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_isomeric, __pyx_v_isomeric) < 0) __PYX_ERR(0, 1064, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 1064, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1064, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 2; __pyx_t_2 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 3) < 0) __PYX_ERR(0, 1064, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1064, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v__ = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_indList, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1065
 *             startindex = self.getSmilesStart()
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)
 *             if itermax:             # <<<<<<<<<<<<<<
 *                 cumul = 0
 *                 moltest = MetaMolecule(data, fullH=fullH)
 */
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_itermax); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1065, __pyx_L1_error)
    if (__pyx_t_12) {

      /* "metaphor/chem_gm/core/metamolecule.py":1066
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)
 *             if itermax:
 *                 cumul = 0             # <<<<<<<<<<<<<<
 *                 moltest = MetaMolecule(data, fullH=fullH)
 *                 datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_v_cumul = __pyx_int_0;

      /* "metaphor/chem_gm/core/metamolecule.py":1067
 *             if itermax:
 *                 cumul = 0
 *                 moltest = MetaMolecule(data, fullH=fullH)             # <<<<<<<<<<<<<<
 *                 datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 *                 while (datatest != data) and cumul < itermax:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __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_v_moltest = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1068
 *                 cumul = 0
 *                 moltest = MetaMolecule(data, fullH=fullH)
 *                 datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)             # <<<<<<<<<<<<<<
 *                 while (datatest != data) and cumul < itermax:
 *                     cumul += 1
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_moltest, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_isomeric);
      __Pyx_GIVEREF(__pyx_v_isomeric);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_isomeric);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_withIndList, Py_True) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1068, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1068, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L19_unpacking_done;
        __pyx_L18_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1068, __pyx_L1_error)
        __pyx_L19_unpacking_done:;
      }
      __pyx_v_datatest = __pyx_t_2;
      __pyx_t_2 = 0;
      __pyx_v_indListTest = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1069
 *                 moltest = MetaMolecule(data, fullH=fullH)
 *                 datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 *                 while (datatest != data) and cumul < itermax:             # <<<<<<<<<<<<<<
 *                     cumul += 1
 *                     data = datatest
 */
      while (1) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_datatest, __pyx_v_data, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error)
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1069, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_13) {
        } else {
          __pyx_t_12 = __pyx_t_13;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_cumul, __pyx_v_itermax, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error)
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1069, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = __pyx_t_13;
        __pyx_L22_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "metaphor/chem_gm/core/metamolecule.py":1070
 *                 datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 *                 while (datatest != data) and cumul < itermax:
 *                     cumul += 1             # <<<<<<<<<<<<<<
 *                     data = datatest
 *                     indListmem = indList[:]
 */
        __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_cumul, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_cumul, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1071
 *                 while (datatest != data) and cumul < itermax:
 *                     cumul += 1
 *                     data = datatest             # <<<<<<<<<<<<<<
 *                     indListmem = indList[:]
 *                     for ind, val in enumerate(indListTest):
 */
        __Pyx_INCREF(__pyx_v_datatest);
        __Pyx_DECREF_SET(__pyx_v_data, __pyx_v_datatest);

        /* "metaphor/chem_gm/core/metamolecule.py":1072
 *                     cumul += 1
 *                     data = datatest
 *                     indListmem = indList[:]             # <<<<<<<<<<<<<<
 *                     for ind, val in enumerate(indListTest):
 *                         indList[ind] = indListmem[val]
 */
        __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_indList, 0, 0, NULL, NULL, &__pyx_slice__23, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_indListmem, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1073
 *                     data = datatest
 *                     indListmem = indList[:]
 *                     for ind, val in enumerate(indListTest):             # <<<<<<<<<<<<<<
 *                         indList[ind] = indListmem[val]
 *                     moltest = MetaMolecule(data, fullH=fullH)
 */
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_1 = __pyx_int_0;
        if (likely(PyList_CheckExact(__pyx_v_indListTest)) || PyTuple_CheckExact(__pyx_v_indListTest)) {
          __pyx_t_3 = __pyx_v_indListTest; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
          __pyx_t_5 = NULL;
        } else {
          __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indListTest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_5)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1073, __pyx_L1_error)
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            } else {
              if (__pyx_t_4 >= 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_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1073, __pyx_L1_error)
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            }
          } else {
            __pyx_t_2 = __pyx_t_5(__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, 1073, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
          __pyx_t_2 = 0;
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_ind, __pyx_t_1);
          __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1);
          __pyx_t_1 = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":1074
 *                     indListmem = indList[:]
 *                     for ind, val in enumerate(indListTest):
 *                         indList[ind] = indListmem[val]             # <<<<<<<<<<<<<<
 *                     moltest = MetaMolecule(data, fullH=fullH)
 *                     datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 */
          __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_indListmem, __pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(PyObject_SetItem(__pyx_v_indList, __pyx_v_ind, __pyx_t_2) < 0)) __PYX_ERR(0, 1074, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "metaphor/chem_gm/core/metamolecule.py":1073
 *                     data = datatest
 *                     indListmem = indList[:]
 *                     for ind, val in enumerate(indListTest):             # <<<<<<<<<<<<<<
 *                         indList[ind] = indListmem[val]
 *                     moltest = MetaMolecule(data, fullH=fullH)
 */
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1075
 *                     for ind, val in enumerate(indListTest):
 *                         indList[ind] = indListmem[val]
 *                     moltest = MetaMolecule(data, fullH=fullH)             # <<<<<<<<<<<<<<
 *                     datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 * 
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1075, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data);
        __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 1075, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1075, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_moltest, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1076
 *                         indList[ind] = indListmem[val]
 *                     moltest = MetaMolecule(data, fullH=fullH)
 *                     datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)             # <<<<<<<<<<<<<<
 * 
 *         if not (withIndList or withname):
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_moltest, __pyx_n_s_getSmiles); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_isomeric);
        __Pyx_GIVEREF(__pyx_v_isomeric);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isomeric);
        __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_withIndList, Py_True) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fullH, __pyx_v_fullH) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1076, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          #else
          __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1076, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
          index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L26_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_3);
          index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L27_unpacking_done;
          __pyx_L26_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1076, __pyx_L1_error)
          __pyx_L27_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_datatest, __pyx_t_3);
        __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_indListTest, __pyx_t_2);
        __pyx_t_2 = 0;
      }

      /* "metaphor/chem_gm/core/metamolecule.py":1065
 *             startindex = self.getSmilesStart()
 *             data, _, indList = self.__smitokens[startindex].getSmiles(self, isomeric=isomeric, fullH=fullH)
 *             if itermax:             # <<<<<<<<<<<<<<
 *                 cumul = 0
 *                 moltest = MetaMolecule(data, fullH=fullH)
 */
    }

    /* "metaphor/chem_gm/core/metamolecule.py":1060
 *         data = ""
 *         indList = []
 *         if len(self.__smitokens):             # <<<<<<<<<<<<<<
 *             for tok in self.__smitokens:
 *                 tok.written = False
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1078
 *                     datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 * 
 *         if not (withIndList or withname):             # <<<<<<<<<<<<<<
 *             return data
 *         if not withIndList:
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_withIndList); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1078, __pyx_L1_error)
  if (!__pyx_t_13) {
  } else {
    __pyx_t_12 = __pyx_t_13;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_withname); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __pyx_t_12 = __pyx_t_13;
  __pyx_L29_bool_binop_done:;
  __pyx_t_13 = ((!__pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "metaphor/chem_gm/core/metamolecule.py":1079
 * 
 *         if not (withIndList or withname):
 *             return data             # <<<<<<<<<<<<<<
 *         if not withIndList:
 *             return self.name, data
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_data);
    __pyx_r = __pyx_v_data;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":1078
 *                     datatest, indListTest = moltest.getSmiles(isomeric, withIndList=True, fullH=fullH)
 * 
 *         if not (withIndList or withname):             # <<<<<<<<<<<<<<
 *             return data
 *         if not withIndList:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1080
 *         if not (withIndList or withname):
 *             return data
 *         if not withIndList:             # <<<<<<<<<<<<<<
 *             return self.name, data
 *         if not withname:
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_withIndList); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __pyx_t_12 = ((!__pyx_t_13) != 0);
  if (__pyx_t_12) {

    /* "metaphor/chem_gm/core/metamolecule.py":1081
 *             return data
 *         if not withIndList:
 *             return self.name, data             # <<<<<<<<<<<<<<
 *         if not withname:
 *             return data, indList
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __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(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_data);
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":1080
 *         if not (withIndList or withname):
 *             return data
 *         if not withIndList:             # <<<<<<<<<<<<<<
 *             return self.name, data
 *         if not withname:
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1082
 *         if not withIndList:
 *             return self.name, data
 *         if not withname:             # <<<<<<<<<<<<<<
 *             return data, indList
 *         return self.name, data, indList
 */
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_withname); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __pyx_t_13 = ((!__pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "metaphor/chem_gm/core/metamolecule.py":1083
 *             return self.name, data
 *         if not withname:
 *             return data, indList             # <<<<<<<<<<<<<<
 *         return self.name, data, indList
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
    __Pyx_INCREF(__pyx_v_indList);
    __Pyx_GIVEREF(__pyx_v_indList);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_indList);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "metaphor/chem_gm/core/metamolecule.py":1082
 *         if not withIndList:
 *             return self.name, data
 *         if not withname:             # <<<<<<<<<<<<<<
 *             return data, indList
 *         return self.name, data, indList
 */
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1084
 *         if not withname:
 *             return data, indList
 *         return self.name, data, indList             # <<<<<<<<<<<<<<
 * 
 *     toSmiles = getSmiles
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __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_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
  __Pyx_INCREF(__pyx_v_indList);
  __Pyx_GIVEREF(__pyx_v_indList);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_indList);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":1036
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmiles(self, isomeric=False, withIndList=False, withname=False, fullH=False, itermax=0, special=[]):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generate a SMILES of the molecule
 *         Inputs:
 */

  /* function 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.MetaMolecule.getSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tok);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_level);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_indList);
  __Pyx_XDECREF(__pyx_v_startindex);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_cumul);
  __Pyx_XDECREF(__pyx_v_moltest);
  __Pyx_XDECREF(__pyx_v_datatest);
  __Pyx_XDECREF(__pyx_v_indListTest);
  __Pyx_XDECREF(__pyx_v_indListmem);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1090
 * # end of class MetaMolecule
 * #-------------------------------------------------------------------------------
 * def adj2dist(Mnadj, MDist, ind, ll):             # <<<<<<<<<<<<<<
 *     res = True
 *     for i in range(ll):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_7adj2dist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_7adj2dist = {"adj2dist", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_7adj2dist, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_7adj2dist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_Mnadj = 0;
  PyObject *__pyx_v_MDist = 0;
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_ll = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("adj2dist (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Mnadj,&__pyx_n_s_MDist,&__pyx_n_s_ind,&__pyx_n_s_ll,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Mnadj)) != 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_MDist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("adj2dist", 1, 4, 4, 1); __PYX_ERR(0, 1090, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("adj2dist", 1, 4, 4, 2); __PYX_ERR(0, 1090, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ll)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("adj2dist", 1, 4, 4, 3); __PYX_ERR(0, 1090, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adj2dist") < 0)) __PYX_ERR(0, 1090, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_Mnadj = values[0];
    __pyx_v_MDist = values[1];
    __pyx_v_ind = values[2];
    __pyx_v_ll = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("adj2dist", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1090, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.adj2dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_6adj2dist(__pyx_self, __pyx_v_Mnadj, __pyx_v_MDist, __pyx_v_ind, __pyx_v_ll);

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_6adj2dist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Mnadj, PyObject *__pyx_v_MDist, PyObject *__pyx_v_ind, PyObject *__pyx_v_ll) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("adj2dist", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1091
 * #-------------------------------------------------------------------------------
 * def adj2dist(Mnadj, MDist, ind, ll):
 *     res = True             # <<<<<<<<<<<<<<
 *     for i in range(ll):
 *         for j in range(i):
 */
  __Pyx_INCREF(Py_True);
  __pyx_v_res = Py_True;

  /* "metaphor/chem_gm/core/metamolecule.py":1092
 * def adj2dist(Mnadj, MDist, ind, ll):
 *     res = True
 *     for i in range(ll):             # <<<<<<<<<<<<<<
 *         for j in range(i):
 *             if not MDist[i, j] and Mnadj[i, j]:
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_ll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1092, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1092, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1093
 *     res = True
 *     for i in range(ll):
 *         for j in range(i):             # <<<<<<<<<<<<<<
 *             if not MDist[i, j] and Mnadj[i, j]:
 *                 MDist[i, j] = ind
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1093, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1093, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1093, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1093, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1093, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1094
 *     for i in range(ll):
 *         for j in range(i):
 *             if not MDist[i, j] and Mnadj[i, j]:             # <<<<<<<<<<<<<<
 *                 MDist[i, j] = ind
 *                 MDist[j, i] = ind
 */
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_i);
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_GIVEREF(__pyx_v_j);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_j);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_MDist, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = ((!__pyx_t_10) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_8 = __pyx_t_11;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_i);
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_GIVEREF(__pyx_v_j);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_j);
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_Mnadj, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1094, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_t_11;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_8) {

        /* "metaphor/chem_gm/core/metamolecule.py":1095
 *         for j in range(i):
 *             if not MDist[i, j] and Mnadj[i, j]:
 *                 MDist[i, j] = ind             # <<<<<<<<<<<<<<
 *                 MDist[j, i] = ind
 *             res = res and MDist[i, j]
 */
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_i);
        __Pyx_INCREF(__pyx_v_j);
        __Pyx_GIVEREF(__pyx_v_j);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_j);
        if (unlikely(PyObject_SetItem(__pyx_v_MDist, __pyx_t_1, __pyx_v_ind) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1096
 *             if not MDist[i, j] and Mnadj[i, j]:
 *                 MDist[i, j] = ind
 *                 MDist[j, i] = ind             # <<<<<<<<<<<<<<
 *             res = res and MDist[i, j]
 *     return res
 */
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_j);
        __Pyx_GIVEREF(__pyx_v_j);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_j);
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_i);
        if (unlikely(PyObject_SetItem(__pyx_v_MDist, __pyx_t_1, __pyx_v_ind) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "metaphor/chem_gm/core/metamolecule.py":1094
 *     for i in range(ll):
 *         for j in range(i):
 *             if not MDist[i, j] and Mnadj[i, j]:             # <<<<<<<<<<<<<<
 *                 MDist[i, j] = ind
 *                 MDist[j, i] = ind
 */
      }

      /* "metaphor/chem_gm/core/metamolecule.py":1097
 *                 MDist[i, j] = ind
 *                 MDist[j, i] = ind
 *             res = res and MDist[i, j]             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1097, __pyx_L1_error)
      if (__pyx_t_8) {
      } else {
        __Pyx_INCREF(__pyx_v_res);
        __pyx_t_1 = __pyx_v_res;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_i);
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_GIVEREF(__pyx_v_j);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_j);
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_MDist, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_1 = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_L10_bool_binop_done:;
      __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1093
 *     res = True
 *     for i in range(ll):
 *         for j in range(i):             # <<<<<<<<<<<<<<
 *             if not MDist[i, j] and Mnadj[i, j]:
 *                 MDist[i, j] = ind
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1092
 * def adj2dist(Mnadj, MDist, ind, ll):
 *     res = True
 *     for i in range(ll):             # <<<<<<<<<<<<<<
 *         for j in range(i):
 *             if not MDist[i, j] and Mnadj[i, j]:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1098
 *                 MDist[j, i] = ind
 *             res = res and MDist[i, j]
 *     return res             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "metaphor/chem_gm/core/metamolecule.py":1090
 * # end of class MetaMolecule
 * #-------------------------------------------------------------------------------
 * def adj2dist(Mnadj, MDist, ind, ll):             # <<<<<<<<<<<<<<
 *     res = True
 *     for i in range(ll):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.adj2dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1101
 * 
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):             # <<<<<<<<<<<<<<
 *     try:
 *         MetaMolecule(value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_9isSmiles(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_9isSmiles = {"isSmiles", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_9isSmiles, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_9isSmiles(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isSmiles (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_8isSmiles(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_8isSmiles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isSmiles", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1102
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):
 *     try:             # <<<<<<<<<<<<<<
 *         MetaMolecule(value)
 *         return True
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/chem_gm/core/metamolecule.py":1103
 * def isSmiles(value):
 *     try:
 *         MetaMolecule(value)             # <<<<<<<<<<<<<<
 *         return True
 *     except SmileParserError:
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1104
 *     try:
 *         MetaMolecule(value)
 *         return True             # <<<<<<<<<<<<<<
 *     except SmileParserError:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "metaphor/chem_gm/core/metamolecule.py":1102
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):
 *     try:             # <<<<<<<<<<<<<<
 *         MetaMolecule(value)
 *         return True
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1105
 *         MetaMolecule(value)
 *         return True
 *     except SmileParserError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_SmileParserError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1105, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_7);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.isSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 1105, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "metaphor/chem_gm/core/metamolecule.py":1106
 *         return True
 *     except SmileParserError:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def isInt(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "metaphor/chem_gm/core/metamolecule.py":1102
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):
 *     try:             # <<<<<<<<<<<<<<
 *         MetaMolecule(value)
 *         return True
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1101
 * 
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):             # <<<<<<<<<<<<<<
 *     try:
 *         MetaMolecule(value)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.isSmiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "metaphor/chem_gm/core/metamolecule.py":1108
 *         return False
 * 
 * def isInt(val):             # <<<<<<<<<<<<<<
 *     try:
 *         int(val)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_11isInt(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/
static PyMethodDef __pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_11isInt = {"isInt", (PyCFunction)__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_11isInt, METH_O, 0};
static PyObject *__pyx_pw_8metaphor_7chem_gm_4core_12metamolecule_11isInt(PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isInt (wrapper)", 0);
  __pyx_r = __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_10isInt(__pyx_self, ((PyObject *)__pyx_v_val));

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

static PyObject *__pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_10isInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("isInt", 0);

  /* "metaphor/chem_gm/core/metamolecule.py":1109
 * 
 * def isInt(val):
 *     try:             # <<<<<<<<<<<<<<
 *         int(val)
 *         return True
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "metaphor/chem_gm/core/metamolecule.py":1110
 * def isInt(val):
 *     try:
 *         int(val)             # <<<<<<<<<<<<<<
 *         return True
 *     except:
 */
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1111
 *     try:
 *         int(val)
 *         return True             # <<<<<<<<<<<<<<
 *     except:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "metaphor/chem_gm/core/metamolecule.py":1109
 * 
 * def isInt(val):
 *     try:             # <<<<<<<<<<<<<<
 *         int(val)
 *         return True
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1112
 *         int(val)
 *         return True
 *     except:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.isInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1112, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "metaphor/chem_gm/core/metamolecule.py":1113
 *         return True
 *     except:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "metaphor/chem_gm/core/metamolecule.py":1109
 * 
 * def isInt(val):
 *     try:             # <<<<<<<<<<<<<<
 *         int(val)
 *         return True
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":1108
 *         return False
 * 
 * def isInt(val):             # <<<<<<<<<<<<<<
 *     try:
 *         int(val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule.isInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_lst);
  Py_CLEAR(p->__pyx_v_markatom);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)o;
  if (p->__pyx_v_lst) {
    e = (*v)(p->__pyx_v_lst, a); if (e) return e;
  }
  if (p->__pyx_v_markatom) {
    e = (*v)(p->__pyx_v_markatom, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles *)o;
  tmp = ((PyObject*)p->__pyx_v_lst);
  p->__pyx_v_lst = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_markatom);
  p->__pyx_v_markatom = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct__addClassToSmiles", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_tok);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_tok) {
    e = (*v)(p->__pyx_v_tok, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_2_postprocess", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_tok);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_tok) {
    e = (*v)(p->__pyx_v_tok, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_atoms);
  Py_CLEAR(p->__pyx_v_bonds);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)o;
  if (p->__pyx_v_atoms) {
    e = (*v)(p->__pyx_v_atoms, a); if (e) return e;
  }
  if (p->__pyx_v_bonds) {
    e = (*v)(p->__pyx_v_bonds, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write *)o;
  tmp = ((PyObject*)p->__pyx_v_atoms);
  p->__pyx_v_atoms = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_bonds);
  p->__pyx_v_bonds = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_4_write", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_val);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_val);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_val) {
    e = (*v)(p->__pyx_v_val, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_centraux);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)o;
  if (p->__pyx_v_centraux) {
    e = (*v)(p->__pyx_v_centraux, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom *)o;
  tmp = ((PyObject*)p->__pyx_v_centraux);
  p->__pyx_v_centraux = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_7_getCentralAtom", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom, /*tp_traverse*/
  __pyx_tp_clear_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_tok);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_tok) {
    e = (*v)(p->__pyx_v_tok, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_already);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_singleton);
  Py_CLEAR(p->__pyx_v_tok);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen *)o;
  if (p->__pyx_v_already) {
    e = (*v)(p->__pyx_v_already, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_singleton) {
    e = (*v)(p->__pyx_v_singleton, a); if (e) return e;
  }
  if (p->__pyx_v_tok) {
    e = (*v)(p->__pyx_v_tok, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_9_atomgen", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds[8];
static int __pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds = 0;

static PyObject *__pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds)))) {
    o = (PyObject*)__pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds[--__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds];
    memset(o, 0, sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds(PyObject *o) {
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_bond);
  Py_CLEAR(p->__pyx_v_mem);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_tok);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds)))) {
    __pyx_freelist_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds[__pyx_freecount_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds++] = ((struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *p = (struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds *)o;
  if (p->__pyx_v_bond) {
    e = (*v)(p->__pyx_v_bond, a); if (e) return e;
  }
  if (p->__pyx_v_mem) {
    e = (*v)(p->__pyx_v_mem, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_tok) {
    e = (*v)(p->__pyx_v_tok, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds = {
  PyVarObject_HEAD_INIT(0, 0)
  "metaphor.chem_gm.core.metamolecule.__pyx_scope_struct_10_bonds", /*tp_name*/
  sizeof(struct __pyx_obj_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_metamolecule(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_metamolecule},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "metamolecule",
    __pyx_k_Definition_of_MetaMolecule_clas, /* 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_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1},
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_12absolute, __pyx_k_12absolute, sizeof(__pyx_k_12absolute), 0, 0, 1, 1},
  {&__pyx_n_s_APPNAME, __pyx_k_APPNAME, sizeof(__pyx_k_APPNAME), 0, 0, 1, 1},
  {&__pyx_n_s_AROMATIC_BOND, __pyx_k_AROMATIC_BOND, sizeof(__pyx_k_AROMATIC_BOND), 0, 0, 1, 1},
  {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
  {&__pyx_kp_u_Cc1cc_C_O_O_ccc_H_1_1, __pyx_k_Cc1cc_C_O_O_ccc_H_1_1, sizeof(__pyx_k_Cc1cc_C_O_O_ccc_H_1_1), 0, 1, 0, 0},
  {&__pyx_kp_u_Cycles, __pyx_k_Cycles, sizeof(__pyx_k_Cycles), 0, 1, 0, 0},
  {&__pyx_n_s_DOUBLE_BOND, __pyx_k_DOUBLE_BOND, sizeof(__pyx_k_DOUBLE_BOND), 0, 0, 1, 1},
  {&__pyx_kp_s_Exception_in_SMILES_parsing, __pyx_k_Exception_in_SMILES_parsing, sizeof(__pyx_k_Exception_in_SMILES_parsing), 0, 0, 1, 0},
  {&__pyx_kp_s_Exception_in_cycle_analysis, __pyx_k_Exception_in_cycle_analysis, sizeof(__pyx_k_Exception_in_cycle_analysis), 0, 0, 1, 0},
  {&__pyx_n_s_GC, __pyx_k_GC, sizeof(__pyx_k_GC), 0, 0, 1, 1},
  {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  {&__pyx_n_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 1},
  {&__pyx_n_s_Htok, __pyx_k_Htok, sizeof(__pyx_k_Htok), 0, 0, 1, 1},
  {&__pyx_n_s_Hydrogenes, __pyx_k_Hydrogenes, sizeof(__pyx_k_Hydrogenes), 0, 0, 1, 1},
  {&__pyx_n_s_ISOALGO_0, __pyx_k_ISOALGO_0, sizeof(__pyx_k_ISOALGO_0), 0, 0, 1, 1},
  {&__pyx_n_s_ISOALGO_PAIR, __pyx_k_ISOALGO_PAIR, sizeof(__pyx_k_ISOALGO_PAIR), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_MDist, __pyx_k_MDist, sizeof(__pyx_k_MDist), 0, 0, 1, 1},
  {&__pyx_n_s_Madj, __pyx_k_Madj, sizeof(__pyx_k_Madj), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule, __pyx_k_MetaMolecule, sizeof(__pyx_k_MetaMolecule), 0, 0, 1, 1},
  {&__pyx_n_s_iso885915_MetaMolecule, __pyx_k_MetaMolecule, sizeof(__pyx_k_MetaMolecule), "iso-8859-15", 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_ReduceIsoGroup, __pyx_k_MetaMolecule_ReduceIsoGroup, sizeof(__pyx_k_MetaMolecule_ReduceIsoGroup), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule___init, __pyx_k_MetaMolecule___init, sizeof(__pyx_k_MetaMolecule___init), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule__analyseinitiale, __pyx_k_MetaMolecule__analyseinitiale, sizeof(__pyx_k_MetaMolecule__analyseinitiale), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule__analyseinitiale_lo, __pyx_k_MetaMolecule__analyseinitiale_lo, sizeof(__pyx_k_MetaMolecule__analyseinitiale_lo), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule__smitokens, __pyx_k_MetaMolecule__smitokens, sizeof(__pyx_k_MetaMolecule__smitokens), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_analyse, __pyx_k_MetaMolecule_analyse, sizeof(__pyx_k_MetaMolecule_analyse), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_analyse_locals_lamb, __pyx_k_MetaMolecule_analyse_locals_lamb, sizeof(__pyx_k_MetaMolecule_analyse_locals_lamb), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_atomgen, __pyx_k_MetaMolecule_atomgen, sizeof(__pyx_k_MetaMolecule_atomgen), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_bonds, __pyx_k_MetaMolecule_bonds, sizeof(__pyx_k_MetaMolecule_bonds), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_clearModelBrokens, __pyx_k_MetaMolecule_clearModelBrokens, sizeof(__pyx_k_MetaMolecule_clearModelBrokens), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_clearbrokens, __pyx_k_MetaMolecule_clearbrokens, sizeof(__pyx_k_MetaMolecule_clearbrokens), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_closureCandidates, __pyx_k_MetaMolecule_closureCandidates, sizeof(__pyx_k_MetaMolecule_closureCandidates), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_computedistances, __pyx_k_MetaMolecule_computedistances, sizeof(__pyx_k_MetaMolecule_computedistances), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_cycles, __pyx_k_MetaMolecule_cycles, sizeof(__pyx_k_MetaMolecule_cycles), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_cycles_locals_lambd, __pyx_k_MetaMolecule_cycles_locals_lambd, sizeof(__pyx_k_MetaMolecule_cycles_locals_lambd), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_equivalentList, __pyx_k_MetaMolecule_equivalentList, sizeof(__pyx_k_MetaMolecule_equivalentList), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getBrokenBonds, __pyx_k_MetaMolecule_getBrokenBonds, sizeof(__pyx_k_MetaMolecule_getBrokenBonds), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getCentralAtom, __pyx_k_MetaMolecule_getCentralAtom, sizeof(__pyx_k_MetaMolecule_getCentralAtom), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getCentralAtom_loca, __pyx_k_MetaMolecule_getCentralAtom_loca, sizeof(__pyx_k_MetaMolecule_getCentralAtom_loca), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getCentralAtom_loca_2, __pyx_k_MetaMolecule_getCentralAtom_loca_2, sizeof(__pyx_k_MetaMolecule_getCentralAtom_loca_2), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getChargeList, __pyx_k_MetaMolecule_getChargeList, sizeof(__pyx_k_MetaMolecule_getChargeList), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getEquivalents, __pyx_k_MetaMolecule_getEquivalents, sizeof(__pyx_k_MetaMolecule_getEquivalents), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getReducedList, __pyx_k_MetaMolecule_getReducedList, sizeof(__pyx_k_MetaMolecule_getReducedList), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getSmiles, __pyx_k_MetaMolecule_getSmiles, sizeof(__pyx_k_MetaMolecule_getSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getSmilesStart, __pyx_k_MetaMolecule_getSmilesStart, sizeof(__pyx_k_MetaMolecule_getSmilesStart), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getSmilesStart_loca, __pyx_k_MetaMolecule_getSmilesStart_loca, sizeof(__pyx_k_MetaMolecule_getSmilesStart_loca), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getdiff, __pyx_k_MetaMolecule_getdiff, sizeof(__pyx_k_MetaMolecule_getdiff), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_getskeleton, __pyx_k_MetaMolecule_getskeleton, sizeof(__pyx_k_MetaMolecule_getskeleton), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_graph, __pyx_k_MetaMolecule_graph, sizeof(__pyx_k_MetaMolecule_graph), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_kekulize, __pyx_k_MetaMolecule_kekulize, sizeof(__pyx_k_MetaMolecule_kekulize), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_mass, __pyx_k_MetaMolecule_mass, sizeof(__pyx_k_MetaMolecule_mass), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_normalizeNumeros, __pyx_k_MetaMolecule_normalizeNumeros, sizeof(__pyx_k_MetaMolecule_normalizeNumeros), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_postprocess, __pyx_k_MetaMolecule_postprocess, sizeof(__pyx_k_MetaMolecule_postprocess), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_postprocess_locals, __pyx_k_MetaMolecule_postprocess_locals, sizeof(__pyx_k_MetaMolecule_postprocess_locals), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_printAll, __pyx_k_MetaMolecule_printAll, sizeof(__pyx_k_MetaMolecule_printAll), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_recreatebrokenbonds, __pyx_k_MetaMolecule_recreatebrokenbonds, sizeof(__pyx_k_MetaMolecule_recreatebrokenbonds), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_remove, __pyx_k_MetaMolecule_remove, sizeof(__pyx_k_MetaMolecule_remove), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_ringClosureMax, __pyx_k_MetaMolecule_ringClosureMax, sizeof(__pyx_k_MetaMolecule_ringClosureMax), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_setGraph, __pyx_k_MetaMolecule_setGraph, sizeof(__pyx_k_MetaMolecule_setGraph), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_splitIsoGroup, __pyx_k_MetaMolecule_splitIsoGroup, sizeof(__pyx_k_MetaMolecule_splitIsoGroup), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_tallyDistanceIndexe, __pyx_k_MetaMolecule_tallyDistanceIndexe, sizeof(__pyx_k_MetaMolecule_tallyDistanceIndexe), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_write, __pyx_k_MetaMolecule_write, sizeof(__pyx_k_MetaMolecule_write), 0, 0, 1, 1},
  {&__pyx_n_s_MetaMolecule_write_locals_genexp, __pyx_k_MetaMolecule_write_locals_genexp, sizeof(__pyx_k_MetaMolecule_write_locals_genexp), 0, 0, 1, 1},
  {&__pyx_n_s_Mnadj, __pyx_k_Mnadj, sizeof(__pyx_k_Mnadj), 0, 0, 1, 1},
  {&__pyx_n_s_OKDraw, __pyx_k_OKDraw, sizeof(__pyx_k_OKDraw), 0, 0, 1, 1},
  {&__pyx_n_s_Property, __pyx_k_Property, sizeof(__pyx_k_Property), 0, 0, 1, 1},
  {&__pyx_n_s_ReduceIsoGroup, __pyx_k_ReduceIsoGroup, sizeof(__pyx_k_ReduceIsoGroup), 0, 0, 1, 1},
  {&__pyx_n_s_SINGLE_BOND, __pyx_k_SINGLE_BOND, sizeof(__pyx_k_SINGLE_BOND), 0, 0, 1, 1},
  {&__pyx_n_s_SmiCycleError, __pyx_k_SmiCycleError, sizeof(__pyx_k_SmiCycleError), 0, 0, 1, 1},
  {&__pyx_n_s_iso885915_SmiCycleError, __pyx_k_SmiCycleError, sizeof(__pyx_k_SmiCycleError), "iso-8859-15", 0, 1, 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_SmileParserError, __pyx_k_SmileParserError, sizeof(__pyx_k_SmileParserError), 0, 0, 1, 1},
  {&__pyx_n_s_iso885915_SmileParserError, __pyx_k_SmileParserError, sizeof(__pyx_k_SmileParserError), "iso-8859-15", 0, 1, 1},
  {&__pyx_n_s_SmileParserError___init, __pyx_k_SmileParserError___init, sizeof(__pyx_k_SmileParserError___init), 0, 0, 1, 1},
  {&__pyx_n_s_SmileParserError_msg, __pyx_k_SmileParserError_msg, sizeof(__pyx_k_SmileParserError_msg), 0, 0, 1, 1},
  {&__pyx_n_s_SmilesToCanonic, __pyx_k_SmilesToCanonic, sizeof(__pyx_k_SmilesToCanonic), 0, 0, 1, 1},
  {&__pyx_kp_u_Smiles_parser_Error, __pyx_k_Smiles_parser_Error, sizeof(__pyx_k_Smiles_parser_Error), 0, 1, 0, 0},
  {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_n_s__58, __pyx_k__58, sizeof(__pyx_k__58), 0, 0, 1, 1},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_n_s_absolutechiral, __pyx_k_absolutechiral, sizeof(__pyx_k_absolutechiral), 0, 0, 1, 1},
  {&__pyx_n_s_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 0, 1, 1},
  {&__pyx_n_s_addClassToSmiles, __pyx_k_addClassToSmiles, sizeof(__pyx_k_addClassToSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_addClassToSmiles_locals_genexpr, __pyx_k_addClassToSmiles_locals_genexpr, sizeof(__pyx_k_addClassToSmiles_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1},
  {&__pyx_n_s_adj2dist, __pyx_k_adj2dist, sizeof(__pyx_k_adj2dist), 0, 0, 1, 1},
  {&__pyx_n_s_already, __pyx_k_already, sizeof(__pyx_k_already), 0, 0, 1, 1},
  {&__pyx_n_s_analyse, __pyx_k_analyse, sizeof(__pyx_k_analyse), 0, 0, 1, 1},
  {&__pyx_n_s_analyseinitiale, __pyx_k_analyseinitiale, sizeof(__pyx_k_analyseinitiale), 0, 0, 1, 1},
  {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
  {&__pyx_n_s_appdatadir, __pyx_k_appdatadir, sizeof(__pyx_k_appdatadir), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_u_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 1, 0, 1},
  {&__pyx_n_s_applidata, __pyx_k_applidata, sizeof(__pyx_k_applidata), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_argv, __pyx_k_argv, sizeof(__pyx_k_argv), 0, 0, 1, 1},
  {&__pyx_n_s_aromatic, __pyx_k_aromatic, sizeof(__pyx_k_aromatic), 0, 0, 1, 1},
  {&__pyx_n_s_aromatic_2, __pyx_k_aromatic_2, sizeof(__pyx_k_aromatic_2), 0, 0, 1, 1},
  {&__pyx_n_s_aromaticterm, __pyx_k_aromaticterm, sizeof(__pyx_k_aromaticterm), 0, 0, 1, 1},
  {&__pyx_n_s_asBond, __pyx_k_asBond, sizeof(__pyx_k_asBond), 0, 0, 1, 1},
  {&__pyx_n_s_atom, __pyx_k_atom, sizeof(__pyx_k_atom), 0, 0, 1, 1},
  {&__pyx_n_s_atomgen, __pyx_k_atomgen, sizeof(__pyx_k_atomgen), 0, 0, 1, 1},
  {&__pyx_n_s_atomicMass, __pyx_k_atomicMass, sizeof(__pyx_k_atomicMass), 0, 0, 1, 1},
  {&__pyx_n_s_atomlst, __pyx_k_atomlst, sizeof(__pyx_k_atomlst), 0, 0, 1, 1},
  {&__pyx_n_s_atomoccur, __pyx_k_atomoccur, sizeof(__pyx_k_atomoccur), 0, 0, 1, 1},
  {&__pyx_n_s_atoms, __pyx_k_atoms, sizeof(__pyx_k_atoms), 0, 0, 1, 1},
  {&__pyx_n_s_atomss, __pyx_k_atomss, sizeof(__pyx_k_atomss), 0, 0, 1, 1},
  {&__pyx_n_s_bb, __pyx_k_bb, sizeof(__pyx_k_bb), 0, 0, 1, 1},
  {&__pyx_n_s_bestof, __pyx_k_bestof, sizeof(__pyx_k_bestof), 0, 0, 1, 1},
  {&__pyx_n_s_blst, __pyx_k_blst, sizeof(__pyx_k_blst), 0, 0, 1, 1},
  {&__pyx_n_s_bond, __pyx_k_bond, sizeof(__pyx_k_bond), 0, 0, 1, 1},
  {&__pyx_n_u_bond, __pyx_k_bond, sizeof(__pyx_k_bond), 0, 1, 0, 1},
  {&__pyx_n_s_bond1, __pyx_k_bond1, sizeof(__pyx_k_bond1), 0, 0, 1, 1},
  {&__pyx_n_s_bond2, __pyx_k_bond2, sizeof(__pyx_k_bond2), 0, 0, 1, 1},
  {&__pyx_n_s_bondOrder, __pyx_k_bondOrder, sizeof(__pyx_k_bondOrder), 0, 0, 1, 1},
  {&__pyx_n_s_bondType, __pyx_k_bondType, sizeof(__pyx_k_bondType), 0, 0, 1, 1},
  {&__pyx_n_s_bonds, __pyx_k_bonds, sizeof(__pyx_k_bonds), 0, 0, 1, 1},
  {&__pyx_n_s_bonds_2, __pyx_k_bonds_2, sizeof(__pyx_k_bonds_2), 0, 0, 1, 1},
  {&__pyx_n_s_bondss, __pyx_k_bondss, sizeof(__pyx_k_bondss), 0, 0, 1, 1},
  {&__pyx_n_s_broken, __pyx_k_broken, sizeof(__pyx_k_broken), 0, 0, 1, 1},
  {&__pyx_n_s_broken_2, __pyx_k_broken_2, sizeof(__pyx_k_broken_2), 0, 0, 1, 1},
  {&__pyx_n_s_cbonds, __pyx_k_cbonds, sizeof(__pyx_k_cbonds), 0, 0, 1, 1},
  {&__pyx_n_s_central, __pyx_k_central, sizeof(__pyx_k_central), 0, 0, 1, 1},
  {&__pyx_n_s_centraux, __pyx_k_centraux, sizeof(__pyx_k_centraux), 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_chem_gm, __pyx_k_chem_gm, sizeof(__pyx_k_chem_gm), 0, 0, 1, 1},
  {&__pyx_n_s_chem_gm_core, __pyx_k_chem_gm_core, sizeof(__pyx_k_chem_gm_core), 0, 0, 1, 1},
  {&__pyx_n_s_chem_gm_core_atoms, __pyx_k_chem_gm_core_atoms, sizeof(__pyx_k_chem_gm_core_atoms), 0, 0, 1, 1},
  {&__pyx_n_s_chem_gm_core_bonds, __pyx_k_chem_gm_core_bonds, sizeof(__pyx_k_chem_gm_core_bonds), 0, 0, 1, 1},
  {&__pyx_n_s_chem_gm_core_gmutils, __pyx_k_chem_gm_core_gmutils, sizeof(__pyx_k_chem_gm_core_gmutils), 0, 0, 1, 1},
  {&__pyx_n_s_chem_gm_core_smitokens, __pyx_k_chem_gm_core_smitokens, sizeof(__pyx_k_chem_gm_core_smitokens), 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_chiralloc, __pyx_k_chiralloc, sizeof(__pyx_k_chiralloc), 0, 0, 1, 1},
  {&__pyx_n_s_chiralmax, __pyx_k_chiralmax, sizeof(__pyx_k_chiralmax), 0, 0, 1, 1},
  {&__pyx_n_s_chiraloccur, __pyx_k_chiraloccur, sizeof(__pyx_k_chiraloccur), 0, 0, 1, 1},
  {&__pyx_kp_s_class_MetaMolecule_This_class_us, __pyx_k_class_MetaMolecule_This_class_us, sizeof(__pyx_k_class_MetaMolecule_This_class_us), 0, 0, 1, 0},
  {&__pyx_n_s_clearModelBrokens, __pyx_k_clearModelBrokens, sizeof(__pyx_k_clearModelBrokens), 0, 0, 1, 1},
  {&__pyx_n_s_clearbrokens, __pyx_k_clearbrokens, sizeof(__pyx_k_clearbrokens), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closureCandidates, __pyx_k_closureCandidates, sizeof(__pyx_k_closureCandidates), 0, 0, 1, 1},
  {&__pyx_n_s_clst, __pyx_k_clst, sizeof(__pyx_k_clst), 0, 0, 1, 1},
  {&__pyx_n_s_cmax, __pyx_k_cmax, sizeof(__pyx_k_cmax), 0, 0, 1, 1},
  {&__pyx_n_s_cmin, __pyx_k_cmin, sizeof(__pyx_k_cmin), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1},
  {&__pyx_n_s_commonBonds, __pyx_k_commonBonds, sizeof(__pyx_k_commonBonds), 0, 0, 1, 1},
  {&__pyx_n_s_commonbonds, __pyx_k_commonbonds, sizeof(__pyx_k_commonbonds), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_computedistances, __pyx_k_computedistances, sizeof(__pyx_k_computedistances), 0, 0, 1, 1},
  {&__pyx_n_s_computedistancesindex, __pyx_k_computedistancesindex, sizeof(__pyx_k_computedistancesindex), 0, 0, 1, 1},
  {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1},
  {&__pyx_n_s_condbond, __pyx_k_condbond, sizeof(__pyx_k_condbond), 0, 0, 1, 1},
  {&__pyx_n_s_condbonds, __pyx_k_condbonds, sizeof(__pyx_k_condbonds), 0, 0, 1, 1},
  {&__pyx_n_s_conds, __pyx_k_conds, sizeof(__pyx_k_conds), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_counted, __pyx_k_counted, sizeof(__pyx_k_counted), 0, 0, 1, 1},
  {&__pyx_n_s_coupurecycles, __pyx_k_coupurecycles, sizeof(__pyx_k_coupurecycles), 0, 0, 1, 1},
  {&__pyx_n_s_cumul, __pyx_k_cumul, sizeof(__pyx_k_cumul), 0, 0, 1, 1},
  {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
  {&__pyx_n_s_cycle_basis, __pyx_k_cycle_basis, sizeof(__pyx_k_cycle_basis), 0, 0, 1, 1},
  {&__pyx_n_s_cycleends, __pyx_k_cycleends, sizeof(__pyx_k_cycleends), 0, 0, 1, 1},
  {&__pyx_n_s_cyclelist, __pyx_k_cyclelist, sizeof(__pyx_k_cyclelist), 0, 0, 1, 1},
  {&__pyx_n_s_cycleloc, __pyx_k_cycleloc, sizeof(__pyx_k_cycleloc), 0, 0, 1, 1},
  {&__pyx_n_s_cycles, __pyx_k_cycles, sizeof(__pyx_k_cycles), 0, 0, 1, 1},
  {&__pyx_n_u_cycles, __pyx_k_cycles, sizeof(__pyx_k_cycles), 0, 1, 0, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_datatest, __pyx_k_datatest, sizeof(__pyx_k_datatest), 0, 0, 1, 1},
  {&__pyx_n_s_dbllst, __pyx_k_dbllst, sizeof(__pyx_k_dbllst), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
  {&__pyx_n_s_delegate, __pyx_k_delegate, sizeof(__pyx_k_delegate), 0, 0, 1, 1},
  {&__pyx_n_u_delitem, __pyx_k_delitem, sizeof(__pyx_k_delitem), 0, 1, 0, 1},
  {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1},
  {&__pyx_n_s_distanceIndex, __pyx_k_distanceIndex, sizeof(__pyx_k_distanceIndex), 0, 0, 1, 1},
  {&__pyx_n_s_distanceIndex_2, __pyx_k_distanceIndex_2, sizeof(__pyx_k_distanceIndex_2), 0, 0, 1, 1},
  {&__pyx_n_s_distances, __pyx_k_distances, sizeof(__pyx_k_distances), 0, 0, 1, 1},
  {&__pyx_n_s_distances_2, __pyx_k_distances_2, sizeof(__pyx_k_distances_2), 0, 0, 1, 1},
  {&__pyx_n_s_distmax, __pyx_k_distmax, sizeof(__pyx_k_distmax), 0, 0, 1, 1},
  {&__pyx_n_s_distsum, __pyx_k_distsum, sizeof(__pyx_k_distsum), 0, 0, 1, 1},
  {&__pyx_n_s_dlst, __pyx_k_dlst, sizeof(__pyx_k_dlst), 0, 0, 1, 1},
  {&__pyx_n_s_dmax, __pyx_k_dmax, sizeof(__pyx_k_dmax), 0, 0, 1, 1},
  {&__pyx_n_s_dmaxlst, __pyx_k_dmaxlst, sizeof(__pyx_k_dmaxlst), 0, 0, 1, 1},
  {&__pyx_n_s_dmmaxmax, __pyx_k_dmmaxmax, sizeof(__pyx_k_dmmaxmax), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_docreate, __pyx_k_docreate, sizeof(__pyx_k_docreate), 0, 0, 1, 1},
  {&__pyx_n_s_docycles, __pyx_k_docycles, sizeof(__pyx_k_docycles), 0, 0, 1, 1},
  {&__pyx_n_u_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 1, 0, 1},
  {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_edges_attr, __pyx_k_edges_attr, sizeof(__pyx_k_edges_attr), 0, 0, 1, 1},
  {&__pyx_n_s_elmt, __pyx_k_elmt, sizeof(__pyx_k_elmt), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_equiv, __pyx_k_equiv, sizeof(__pyx_k_equiv), 0, 0, 1, 1},
  {&__pyx_n_s_equivalent, __pyx_k_equivalent, sizeof(__pyx_k_equivalent), 0, 0, 1, 1},
  {&__pyx_n_s_equivalentList, __pyx_k_equivalentList, sizeof(__pyx_k_equivalentList), 0, 0, 1, 1},
  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
  {&__pyx_n_s_errortype, __pyx_k_errortype, sizeof(__pyx_k_errortype), 0, 0, 1, 1},
  {&__pyx_n_s_excluded, __pyx_k_excluded, sizeof(__pyx_k_excluded), 0, 0, 1, 1},
  {&__pyx_n_s_existingH, __pyx_k_existingH, sizeof(__pyx_k_existingH), 0, 0, 1, 1},
  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_ff, __pyx_k_ff, sizeof(__pyx_k_ff), 0, 0, 1, 1},
  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
  {&__pyx_n_s_findinlist, __pyx_k_findinlist, sizeof(__pyx_k_findinlist), 0, 0, 1, 1},
  {&__pyx_n_s_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 0, 1, 1},
  {&__pyx_n_s_fragmentweight, __pyx_k_fragmentweight, sizeof(__pyx_k_fragmentweight), 0, 0, 1, 1},
  {&__pyx_n_s_fullH, __pyx_k_fullH, sizeof(__pyx_k_fullH), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_getBondTo, __pyx_k_getBondTo, sizeof(__pyx_k_getBondTo), 0, 0, 1, 1},
  {&__pyx_n_s_getBrokenBonds, __pyx_k_getBrokenBonds, sizeof(__pyx_k_getBrokenBonds), 0, 0, 1, 1},
  {&__pyx_n_s_getCentralAtom, __pyx_k_getCentralAtom, sizeof(__pyx_k_getCentralAtom), 0, 0, 1, 1},
  {&__pyx_n_s_getChargeList, __pyx_k_getChargeList, sizeof(__pyx_k_getChargeList), 0, 0, 1, 1},
  {&__pyx_n_s_getEquivalents, __pyx_k_getEquivalents, sizeof(__pyx_k_getEquivalents), 0, 0, 1, 1},
  {&__pyx_n_s_getReducedList, __pyx_k_getReducedList, sizeof(__pyx_k_getReducedList), 0, 0, 1, 1},
  {&__pyx_n_s_getSmiles, __pyx_k_getSmiles, sizeof(__pyx_k_getSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_getSmilesStart, __pyx_k_getSmilesStart, sizeof(__pyx_k_getSmilesStart), 0, 0, 1, 1},
  {&__pyx_n_s_get_edge_attributes, __pyx_k_get_edge_attributes, sizeof(__pyx_k_get_edge_attributes), 0, 0, 1, 1},
  {&__pyx_n_s_getdiff, __pyx_k_getdiff, sizeof(__pyx_k_getdiff), 0, 0, 1, 1},
  {&__pyx_n_u_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 0, 1},
  {&__pyx_n_s_getskeleton, __pyx_k_getskeleton, sizeof(__pyx_k_getskeleton), 0, 0, 1, 1},
  {&__pyx_n_s_gmconstants, __pyx_k_gmconstants, sizeof(__pyx_k_gmconstants), 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_gradeloc, __pyx_k_gradeloc, sizeof(__pyx_k_gradeloc), 0, 0, 1, 1},
  {&__pyx_n_s_gradeoccur, __pyx_k_gradeoccur, sizeof(__pyx_k_gradeoccur), 0, 0, 1, 1},
  {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
  {&__pyx_n_s_graph_2, __pyx_k_graph_2, sizeof(__pyx_k_graph_2), 0, 0, 1, 1},
  {&__pyx_n_u_graphmachine, __pyx_k_graphmachine, sizeof(__pyx_k_graphmachine), 0, 1, 0, 1},
  {&__pyx_n_s_hasbondto, __pyx_k_hasbondto, sizeof(__pyx_k_hasbondto), 0, 0, 1, 1},
  {&__pyx_n_s_hcount, __pyx_k_hcount, sizeof(__pyx_k_hcount), 0, 0, 1, 1},
  {&__pyx_n_s_hcount_2, __pyx_k_hcount_2, sizeof(__pyx_k_hcount_2), 0, 0, 1, 1},
  {&__pyx_n_s_holder, __pyx_k_holder, sizeof(__pyx_k_holder), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_includebroken, __pyx_k_includebroken, sizeof(__pyx_k_includebroken), 0, 0, 1, 1},
  {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
  {&__pyx_n_s_indList, __pyx_k_indList, sizeof(__pyx_k_indList), 0, 0, 1, 1},
  {&__pyx_n_s_indListTest, __pyx_k_indListTest, sizeof(__pyx_k_indListTest), 0, 0, 1, 1},
  {&__pyx_n_s_indListmem, __pyx_k_indListmem, sizeof(__pyx_k_indListmem), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_indexOnly, __pyx_k_indexOnly, sizeof(__pyx_k_indexOnly), 0, 0, 1, 1},
  {&__pyx_n_s_indexlist, __pyx_k_indexlist, sizeof(__pyx_k_indexlist), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_u_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 1, 0, 1},
  {&__pyx_n_s_invalid, __pyx_k_invalid, sizeof(__pyx_k_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_isInt, __pyx_k_isInt, sizeof(__pyx_k_isInt), 0, 0, 1, 1},
  {&__pyx_n_s_isSmiles, __pyx_k_isSmiles, sizeof(__pyx_k_isSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_islice, __pyx_k_islice, sizeof(__pyx_k_islice), 0, 0, 1, 1},
  {&__pyx_n_s_iso, __pyx_k_iso, sizeof(__pyx_k_iso), 0, 0, 1, 1},
  {&__pyx_n_s_iso_2, __pyx_k_iso_2, sizeof(__pyx_k_iso_2), 0, 0, 1, 1},
  {&__pyx_n_s_isoalgo, __pyx_k_isoalgo, sizeof(__pyx_k_isoalgo), 0, 0, 1, 1},
  {&__pyx_n_s_isoalgodefault, __pyx_k_isoalgodefault, sizeof(__pyx_k_isoalgodefault), 0, 0, 1, 1},
  {&__pyx_n_s_isokey, __pyx_k_isokey, sizeof(__pyx_k_isokey), 0, 0, 1, 1},
  {&__pyx_n_s_isolatedindex, __pyx_k_isolatedindex, sizeof(__pyx_k_isolatedindex), 0, 0, 1, 1},
  {&__pyx_n_s_isolatediso, __pyx_k_isolatediso, sizeof(__pyx_k_isolatediso), 0, 0, 1, 1},
  {&__pyx_n_s_isoloc, __pyx_k_isoloc, sizeof(__pyx_k_isoloc), 0, 0, 1, 1},
  {&__pyx_n_s_isomax, __pyx_k_isomax, sizeof(__pyx_k_isomax), 0, 0, 1, 1},
  {&__pyx_n_s_isomeric, __pyx_k_isomeric, sizeof(__pyx_k_isomeric), 0, 0, 1, 1},
  {&__pyx_n_s_isooccur, __pyx_k_isooccur, sizeof(__pyx_k_isooccur), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_u_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 0, 1},
  {&__pyx_n_s_itermax, __pyx_k_itermax, sizeof(__pyx_k_itermax), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_kekulize, __pyx_k_kekulize, sizeof(__pyx_k_kekulize), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keyAtoms, __pyx_k_keyAtoms, sizeof(__pyx_k_keyAtoms), 0, 0, 1, 1},
  {&__pyx_n_s_keyForChiral, __pyx_k_keyForChiral, sizeof(__pyx_k_keyForChiral), 0, 0, 1, 1},
  {&__pyx_n_s_keyForClosure, __pyx_k_keyForClosure, sizeof(__pyx_k_keyForClosure), 0, 0, 1, 1},
  {&__pyx_n_s_keyinv, __pyx_k_keyinv, sizeof(__pyx_k_keyinv), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwd, __pyx_k_kwd, sizeof(__pyx_k_kwd), 0, 0, 1, 1},
  {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
  {&__pyx_n_u_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 1, 0, 1},
  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
  {&__pyx_n_s_lex, __pyx_k_lex, sizeof(__pyx_k_lex), 0, 0, 1, 1},
  {&__pyx_n_s_lexer, __pyx_k_lexer, sizeof(__pyx_k_lexer), 0, 0, 1, 1},
  {&__pyx_n_s_lexline, __pyx_k_lexline, sizeof(__pyx_k_lexline), 0, 0, 1, 1},
  {&__pyx_n_s_lexpos, __pyx_k_lexpos, sizeof(__pyx_k_lexpos), 0, 0, 1, 1},
  {&__pyx_n_s_lextab, __pyx_k_lextab, sizeof(__pyx_k_lextab), 0, 0, 1, 1},
  {&__pyx_kp_u_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 1, 0, 0},
  {&__pyx_kp_u_line_2, __pyx_k_line_2, sizeof(__pyx_k_line_2), 0, 1, 0, 0},
  {&__pyx_n_s_linkedto, __pyx_k_linkedto, sizeof(__pyx_k_linkedto), 0, 0, 1, 1},
  {&__pyx_n_s_ll, __pyx_k_ll, sizeof(__pyx_k_ll), 0, 0, 1, 1},
  {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1},
  {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1},
  {&__pyx_n_s_lsti, __pyx_k_lsti, sizeof(__pyx_k_lsti), 0, 0, 1, 1},
  {&__pyx_n_s_lstloc, __pyx_k_lstloc, sizeof(__pyx_k_lstloc), 0, 0, 1, 1},
  {&__pyx_kp_u_m_toluic_acid0, __pyx_k_m_toluic_acid0, sizeof(__pyx_k_m_toluic_acid0), 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_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mark, __pyx_k_mark, sizeof(__pyx_k_mark), 0, 0, 1, 1},
  {&__pyx_n_s_markatom, __pyx_k_markatom, sizeof(__pyx_k_markatom), 0, 0, 1, 1},
  {&__pyx_n_s_mass, __pyx_k_mass, sizeof(__pyx_k_mass), 0, 0, 1, 1},
  {&__pyx_n_s_massmem, __pyx_k_massmem, sizeof(__pyx_k_massmem), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_max_map, __pyx_k_max_map, sizeof(__pyx_k_max_map), 0, 0, 1, 1},
  {&__pyx_n_s_maxiter, __pyx_k_maxiter, sizeof(__pyx_k_maxiter), 0, 0, 1, 1},
  {&__pyx_n_s_mem, __pyx_k_mem, sizeof(__pyx_k_mem), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 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_metamolecu, __pyx_k_metaphor_chem_gm_core_metamolecu, sizeof(__pyx_k_metaphor_chem_gm_core_metamolecu), 0, 0, 1, 1},
  {&__pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_k_metaphor_chem_gm_core_metamolecu_2, sizeof(__pyx_k_metaphor_chem_gm_core_metamolecu_2), 0, 0, 1, 0},
  {&__pyx_n_s_missingH, __pyx_k_missingH, sizeof(__pyx_k_missingH), 0, 0, 1, 1},
  {&__pyx_n_s_mkdir, __pyx_k_mkdir, sizeof(__pyx_k_mkdir), 0, 0, 1, 1},
  {&__pyx_n_s_modelbroken, __pyx_k_modelbroken, sizeof(__pyx_k_modelbroken), 0, 0, 1, 1},
  {&__pyx_n_s_modelbroken_2, __pyx_k_modelbroken_2, sizeof(__pyx_k_modelbroken_2), 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_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_n_s_mol, __pyx_k_mol, sizeof(__pyx_k_mol), 0, 0, 1, 1},
  {&__pyx_n_s_moltest, __pyx_k_moltest, sizeof(__pyx_k_moltest), 0, 0, 1, 1},
  {&__pyx_n_s_monal_Property, __pyx_k_monal_Property, sizeof(__pyx_k_monal_Property), 0, 0, 1, 1},
  {&__pyx_n_s_monal_util_toolbox, __pyx_k_monal_util_toolbox, sizeof(__pyx_k_monal_util_toolbox), 0, 0, 1, 1},
  {&__pyx_n_s_monal_util_utils, __pyx_k_monal_util_utils, sizeof(__pyx_k_monal_util_utils), 0, 0, 1, 1},
  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_kp_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 0},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1},
  {&__pyx_n_s_networkx, __pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 0, 1, 1},
  {&__pyx_n_s_normalizeChiral, __pyx_k_normalizeChiral, sizeof(__pyx_k_normalizeChiral), 0, 0, 1, 1},
  {&__pyx_n_s_normalizeNumeros, __pyx_k_normalizeNumeros, sizeof(__pyx_k_normalizeNumeros), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_numero, __pyx_k_numero, sizeof(__pyx_k_numero), 0, 0, 1, 1},
  {&__pyx_n_s_numero_2, __pyx_k_numero_2, sizeof(__pyx_k_numero_2), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_occurmols, __pyx_k_occurmols, sizeof(__pyx_k_occurmols), 0, 0, 1, 1},
  {&__pyx_n_s_occurmolsloc, __pyx_k_occurmolsloc, sizeof(__pyx_k_occurmolsloc), 0, 0, 1, 1},
  {&__pyx_n_s_occurs, __pyx_k_occurs, sizeof(__pyx_k_occurs), 0, 0, 1, 1},
  {&__pyx_n_s_occursloc, __pyx_k_occursloc, sizeof(__pyx_k_occursloc), 0, 0, 1, 1},
  {&__pyx_n_s_optimize, __pyx_k_optimize, sizeof(__pyx_k_optimize), 0, 0, 1, 1},
  {&__pyx_n_s_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_outputdir, __pyx_k_outputdir, sizeof(__pyx_k_outputdir), 0, 0, 1, 1},
  {&__pyx_n_s_outputindex, __pyx_k_outputindex, sizeof(__pyx_k_outputindex), 0, 0, 1, 1},
  {&__pyx_n_s_outstyle, __pyx_k_outstyle, sizeof(__pyx_k_outstyle), 0, 0, 1, 1},
  {&__pyx_n_s_pair, __pyx_k_pair, sizeof(__pyx_k_pair), 0, 0, 1, 1},
  {&__pyx_n_s_par, __pyx_k_par, sizeof(__pyx_k_par), 0, 0, 1, 1},
  {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
  {&__pyx_n_u_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 1, 0, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_picklefile, __pyx_k_picklefile, sizeof(__pyx_k_picklefile), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_u_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 0, 1},
  {&__pyx_n_s_populatebrokenbonds, __pyx_k_populatebrokenbonds, sizeof(__pyx_k_populatebrokenbonds), 0, 0, 1, 1},
  {&__pyx_kp_u_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 1, 0, 0},
  {&__pyx_n_s_postprocess, __pyx_k_postprocess, sizeof(__pyx_k_postprocess), 0, 0, 1, 1},
  {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_printAll, __pyx_k_printAll, sizeof(__pyx_k_printAll), 0, 0, 1, 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_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1},
  {&__pyx_n_s_rawiso, __pyx_k_rawiso, sizeof(__pyx_k_rawiso), 0, 0, 1, 1},
  {&__pyx_n_s_rawiso_2, __pyx_k_rawiso_2, sizeof(__pyx_k_rawiso_2), 0, 0, 1, 1},
  {&__pyx_n_s_rawisogroups, __pyx_k_rawisogroups, sizeof(__pyx_k_rawisogroups), 0, 0, 1, 1},
  {&__pyx_n_s_rawisolist, __pyx_k_rawisolist, sizeof(__pyx_k_rawisolist), 0, 0, 1, 1},
  {&__pyx_n_s_recreatebrokenbonds, __pyx_k_recreatebrokenbonds, sizeof(__pyx_k_recreatebrokenbonds), 0, 0, 1, 1},
  {&__pyx_n_s_reduced, __pyx_k_reduced, sizeof(__pyx_k_reduced), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_res2, __pyx_k_res2, sizeof(__pyx_k_res2), 0, 0, 1, 1},
  {&__pyx_n_s_res3, __pyx_k_res3, sizeof(__pyx_k_res3), 0, 0, 1, 1},
  {&__pyx_n_s_resloc, __pyx_k_resloc, sizeof(__pyx_k_resloc), 0, 0, 1, 1},
  {&__pyx_n_u_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 1, 0, 1},
  {&__pyx_n_s_ringClosureMax, __pyx_k_ringClosureMax, sizeof(__pyx_k_ringClosureMax), 0, 0, 1, 1},
  {&__pyx_n_s_ringmodel, __pyx_k_ringmodel, sizeof(__pyx_k_ringmodel), 0, 0, 1, 1},
  {&__pyx_n_s_ringsmiles, __pyx_k_ringsmiles, sizeof(__pyx_k_ringsmiles), 0, 0, 1, 1},
  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_sequence, __pyx_k_sequence, sizeof(__pyx_k_sequence), 0, 0, 1, 1},
  {&__pyx_n_s_setGraph, __pyx_k_setGraph, sizeof(__pyx_k_setGraph), 0, 0, 1, 1},
  {&__pyx_n_s_setH, __pyx_k_setH, sizeof(__pyx_k_setH), 0, 0, 1, 1},
  {&__pyx_n_s_setcbondto, __pyx_k_setcbondto, sizeof(__pyx_k_setcbondto), 0, 0, 1, 1},
  {&__pyx_n_u_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 1, 0, 1},
  {&__pyx_n_s_singleterminals, __pyx_k_singleterminals, sizeof(__pyx_k_singleterminals), 0, 0, 1, 1},
  {&__pyx_n_s_singleton, __pyx_k_singleton, sizeof(__pyx_k_singleton), 0, 0, 1, 1},
  {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
  {&__pyx_n_s_skeleton, __pyx_k_skeleton, sizeof(__pyx_k_skeleton), 0, 0, 1, 1},
  {&__pyx_n_s_smi, __pyx_k_smi, sizeof(__pyx_k_smi), 0, 0, 1, 1},
  {&__pyx_n_s_smiles, __pyx_k_smiles, sizeof(__pyx_k_smiles), 0, 0, 1, 1},
  {&__pyx_n_s_smilex, __pyx_k_smilex, sizeof(__pyx_k_smilex), 0, 0, 1, 1},
  {&__pyx_n_s_smilexer, __pyx_k_smilexer, sizeof(__pyx_k_smilexer), 0, 0, 1, 1},
  {&__pyx_n_u_smilextab, __pyx_k_smilextab, sizeof(__pyx_k_smilextab), 0, 1, 0, 1},
  {&__pyx_n_s_smiparserspec, __pyx_k_smiparserspec, sizeof(__pyx_k_smiparserspec), 0, 0, 1, 1},
  {&__pyx_kp_u_smiparsetab_pyl, __pyx_k_smiparsetab_pyl, sizeof(__pyx_k_smiparsetab_pyl), 0, 1, 0, 0},
  {&__pyx_n_s_smitokens, __pyx_k_smitokens, sizeof(__pyx_k_smitokens), 0, 0, 1, 1},
  {&__pyx_n_u_smitokens_2, __pyx_k_smitokens_2, sizeof(__pyx_k_smitokens_2), 0, 1, 0, 1},
  {&__pyx_n_s_sname, __pyx_k_sname, sizeof(__pyx_k_sname), 0, 0, 1, 1},
  {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1},
  {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_special, __pyx_k_special, sizeof(__pyx_k_special), 0, 0, 1, 1},
  {&__pyx_n_s_special_2, __pyx_k_special_2, sizeof(__pyx_k_special_2), 0, 0, 1, 1},
  {&__pyx_n_s_splitIsoGroup, __pyx_k_splitIsoGroup, sizeof(__pyx_k_splitIsoGroup), 0, 0, 1, 1},
  {&__pyx_n_s_squaredistmax, __pyx_k_squaredistmax, sizeof(__pyx_k_squaredistmax), 0, 0, 1, 1},
  {&__pyx_n_s_sqyaredistsum, __pyx_k_sqyaredistsum, sizeof(__pyx_k_sqyaredistsum), 0, 0, 1, 1},
  {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1},
  {&__pyx_n_s_stabilizeSmiles, __pyx_k_stabilizeSmiles, sizeof(__pyx_k_stabilizeSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_stableSmiles, __pyx_k_stableSmiles, sizeof(__pyx_k_stableSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_startindex, __pyx_k_startindex, sizeof(__pyx_k_startindex), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_u_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 1, 0, 1},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 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_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
  {&__pyx_n_s_t2, __pyx_k_t2, sizeof(__pyx_k_t2), 0, 0, 1, 1},
  {&__pyx_n_s_tallyDistanceIndexes, __pyx_k_tallyDistanceIndexes, sizeof(__pyx_k_tallyDistanceIndexes), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_terminals, __pyx_k_terminals, sizeof(__pyx_k_terminals), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_s_tg1, __pyx_k_tg1, sizeof(__pyx_k_tg1), 0, 0, 1, 1},
  {&__pyx_n_s_tg2, __pyx_k_tg2, sizeof(__pyx_k_tg2), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tl, __pyx_k_tl, sizeof(__pyx_k_tl), 0, 0, 1, 1},
  {&__pyx_n_s_toSmiles, __pyx_k_toSmiles, sizeof(__pyx_k_toSmiles), 0, 0, 1, 1},
  {&__pyx_n_s_tok, __pyx_k_tok, sizeof(__pyx_k_tok), 0, 0, 1, 1},
  {&__pyx_n_s_tok2, __pyx_k_tok2, sizeof(__pyx_k_tok2), 0, 0, 1, 1},
  {&__pyx_n_s_tokenKeyValue, __pyx_k_tokenKeyValue, sizeof(__pyx_k_tokenKeyValue), 0, 0, 1, 1},
  {&__pyx_n_s_toklst, __pyx_k_toklst, sizeof(__pyx_k_toklst), 0, 0, 1, 1},
  {&__pyx_n_s_tokringdict, __pyx_k_tokringdict, sizeof(__pyx_k_tokringdict), 0, 0, 1, 1},
  {&__pyx_n_s_tokringlist, __pyx_k_tokringlist, sizeof(__pyx_k_tokringlist), 0, 0, 1, 1},
  {&__pyx_n_s_type0, __pyx_k_type0, sizeof(__pyx_k_type0), 0, 0, 1, 1},
  {&__pyx_n_s_type1, __pyx_k_type1, sizeof(__pyx_k_type1), 0, 0, 1, 1},
  {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_valence, __pyx_k_valence, sizeof(__pyx_k_valence), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
  {&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1},
  {&__pyx_n_s_withIndList, __pyx_k_withIndList, sizeof(__pyx_k_withIndList), 0, 0, 1, 1},
  {&__pyx_n_s_withindex, __pyx_k_withindex, sizeof(__pyx_k_withindex), 0, 0, 1, 1},
  {&__pyx_n_s_withname, __pyx_k_withname, sizeof(__pyx_k_withname), 0, 0, 1, 1},
  {&__pyx_n_s_withoccurences, __pyx_k_withoccurences, sizeof(__pyx_k_withoccurences), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1},
  {&__pyx_n_u_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 1, 0, 1},
  {&__pyx_n_s_written, __pyx_k_written, sizeof(__pyx_k_written), 0, 0, 1, 1},
  {&__pyx_n_s_yacc, __pyx_k_yacc, sizeof(__pyx_k_yacc), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 160, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 1124, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 197, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 229, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 230, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 255, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 323, __pyx_L1_error)
  __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 325, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 661, __pyx_L1_error)
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 804, __pyx_L1_error)
  __pyx_builtin_filter = __Pyx_GetBuiltinName(__pyx_n_s_filter); if (!__pyx_builtin_filter) __PYX_ERR(0, 812, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 954, __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/metamolecule.py":94
 *         st = "%s line: %d\n\t"%(self.errortype, self.lexline)
 *         #try:
 *         st += "%s\n\t%s%s" %(self.smiles, mark, six.unichr(0x2191))#02c6             # <<<<<<<<<<<<<<
 * #         except:
 * #             st += "%s\n\t%s%s" %(self.smiles, mark, unichr(0x2191))#02c6
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_8593); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "metaphor/chem_gm/core/metamolecule.py":148
 *             massmem = tok._atomicMass
 *             tok._atomicMass = prefix
 *         smi = mol.getSmiles(True, fullH=fullH)             # <<<<<<<<<<<<<<
 *         if withindex:
 *             res.append((tok.numero, smi))
 */
  __pyx_tuple__8 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "metaphor/chem_gm/core/metamolecule.py":186
 *         self.__smitokens = []
 *         self.smiles = raw(smiles).strip()
 *         outputdir = appdatadir("parser", APPNAME="graphmachine", docreate=True)             # <<<<<<<<<<<<<<
 *         if not os.path.exists(outputdir):
 *             os.mkdir(outputdir)
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_u_parser); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "metaphor/chem_gm/core/metamolecule.py":255
 *         if commonBonds:
 *             res3 = []
 *             for ind, clst in enumerate(res[:-1]):             # <<<<<<<<<<<<<<
 *                 for bond in clst:
 *                     for lst in res[ind+1:]:
 */
  __pyx_slice__10 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__10);
  __Pyx_GIVEREF(__pyx_slice__10);

  /* "metaphor/chem_gm/core/metamolecule.py":272
 *             lstloc = [bond for bond in lst if not bond in commonbonds]
 *             if not len(lstloc):
 *                 lstloc = lst[:1]             # <<<<<<<<<<<<<<
 *             resloc.append(lstloc)
 *         res = resloc
 */
  __pyx_slice__11 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__11);
  __Pyx_GIVEREF(__pyx_slice__11);

  /* "metaphor/chem_gm/core/metamolecule.py":515
 *             return res
 *         dbllst = []
 *         for ind, tok in enumerate(lst[:-1]):             # <<<<<<<<<<<<<<
 *             if tok.hasbondto(lst[ind+1], 2):
 *                 dbllst.append((ind, ind+1))
 */
  __pyx_slice__12 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__12);
  __Pyx_GIVEREF(__pyx_slice__12);

  /* "metaphor/chem_gm/core/metamolecule.py":573
 *         if self.smiles:
 *             ff.write(self.smiles + "\n")
 *         argv = argv if len(argv) else (None,)             # <<<<<<<<<<<<<<
 *         for tok in islice(self.__smitokens, *argv):
 *             ff.write(str(tok))
 */
  __pyx_tuple__13 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "metaphor/chem_gm/core/metamolecule.py":576
 *         for tok in islice(self.__smitokens, *argv):
 *             ff.write(str(tok))
 *             ff.write("\n")             # <<<<<<<<<<<<<<
 *         if docycles:
 *             bondss = self.cycles(asBond=True, ordered=True)
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u__7); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "metaphor/chem_gm/core/metamolecule.py":581
 *             atomss = self.cycles(asBond=False, ordered=True)
 *             if len(bondss):
 *                 ff.write("\nCycles :\n")             # <<<<<<<<<<<<<<
 *                 for bonds, atoms in zip(bondss, atomss):
 *                     ff.write("\t(%s)\n"% ",".join(repr(val) for val in atoms))
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Cycles); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "metaphor/chem_gm/core/metamolecule.py":693
 *         if occurmols is None:
 *             occurmols = defaultdict(lambda:0)
 *         resloc, gradeloc, isoloc, chiralloc, occursloc, occurmolsloc, cycleloc, chargelist = self._analyseinitiale(True)             # <<<<<<<<<<<<<<
 *         for val in occurmolsloc:
 *             occurmols[val] += 1
 */
  __pyx_tuple__19 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "metaphor/chem_gm/core/metamolecule.py":982
 *                     terminals = aromaticterm
 *         else:
 *             terminals = self.__smitokens[:]             # <<<<<<<<<<<<<<
 *         terminals = sorted(terminals, key = keyForChiral)
 * 
 */
  __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__22);
  __Pyx_GIVEREF(__pyx_slice__22);

  /* "metaphor/chem_gm/core/metamolecule.py":1072
 *                     cumul += 1
 *                     data = datatest
 *                     indListmem = indList[:]             # <<<<<<<<<<<<<<
 *                     for ind, val in enumerate(indListTest):
 *                         indList[ind] = indListmem[val]
 */
  __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__23);
  __Pyx_GIVEREF(__pyx_slice__23);

  /* "metaphor/chem_gm/core/metamolecule.py":71
 *     """Exception in SMILES parsing
 *     """
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):             # <<<<<<<<<<<<<<
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles
 */
  __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_smiles, __pyx_n_s_sequence, __pyx_n_s_lexline, __pyx_n_s_lexpos, __pyx_n_s_modelname); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_init, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 71, __pyx_L1_error)
  __pyx_tuple__26 = PyTuple_Pack(6, ((PyObject*)__pyx_kp_u_Smiles_parser_Error), ((PyObject*)__pyx_kp_u_), ((PyObject*)__pyx_kp_u_), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u_)); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "metaphor/chem_gm/core/metamolecule.py":88
 * 
 *     @Property
 *     def msg(self):             # <<<<<<<<<<<<<<
 *         if not self.smiles:
 *             return self.message
 */
  __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mark, __pyx_n_s_st); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_msg, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 88, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":100
 * 
 * #-------------------------------------------------------------------------------
 * def SmilesToCanonic(source, isomeric=False, kekulize=0, indexlist=False, withname=False, fullH=False, itermax=0):             # <<<<<<<<<<<<<<
 *     """Convert a SMILES to a canonic SMILES
 *     """
 */
  __pyx_tuple__29 = PyTuple_Pack(12, __pyx_n_s_source, __pyx_n_s_isomeric, __pyx_n_s_kekulize, __pyx_n_s_indexlist, __pyx_n_s_withname, __pyx_n_s_fullH, __pyx_n_s_itermax, __pyx_n_s_res, __pyx_n_s_mol, __pyx_n_s_sname, __pyx_n_s_smi, __pyx_n_s_val); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_SmilesToCanonic, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 100, __pyx_L1_error)
  __pyx_tuple__31 = PyTuple_Pack(6, ((PyObject *)Py_False), ((PyObject *)__pyx_int_0), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "metaphor/chem_gm/core/metamolecule.py":124
 *     return res
 * 
 * def stabilizeSmiles(source, isomeric=False, indexlist=False, withname=False, fullH=False, itermax=10):             # <<<<<<<<<<<<<<
 *     """Gives a stable SMILES
 *     """
 */
  __pyx_tuple__32 = PyTuple_Pack(6, __pyx_n_s_source, __pyx_n_s_isomeric, __pyx_n_s_indexlist, __pyx_n_s_withname, __pyx_n_s_fullH, __pyx_n_s_itermax); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_stabilizeSmiles, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 124, __pyx_L1_error)
  __pyx_tuple__34 = PyTuple_Pack(5, ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */
  __pyx_tuple__35 = PyTuple_Pack(18, __pyx_n_s_source, __pyx_n_s_markatom, __pyx_n_s_data, __pyx_n_s_prefix, __pyx_n_s_reduced, __pyx_n_s_fullH, __pyx_n_s_withindex, __pyx_n_s_stableSmiles, __pyx_n_s_mol, __pyx_n_s_lst, __pyx_n_s_toklst, __pyx_n_s_res, __pyx_n_s_tok, __pyx_n_s_mem, __pyx_n_s_massmem, __pyx_n_s_smi, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 18, 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_metamolecu_2, __pyx_n_s_addClassToSmiles, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 129, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":160
 * @delegate(["__smitokens", '__delitem__', "__getitem__", "__setitem__", "__iter__",
 *            "__reversed__", "__len__", "__str__", "pop", "append", "insert"])
 * class MetaMolecule(object):  # ex tokenlist             # <<<<<<<<<<<<<<
 *     """class MetaMolecule.
 *     This class uses the PLY based lexer and parser.
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "metaphor/chem_gm/core/metamolecule.py":180
 * #     - insert
 * 
 *     def __init__(self, smiles, name="", isoalgo=isoalgodefault, fullH=setH):             # <<<<<<<<<<<<<<
 *         '''MetaMolecule constructor
 *         '''
 */
  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_smiles, __pyx_n_s_name_2, __pyx_n_s_isoalgo, __pyx_n_s_fullH, __pyx_n_s_outputdir, __pyx_n_s_picklefile, __pyx_n_s_err); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_init, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 180, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":207
 *         self.invalid = True
 * 
 *     def setGraph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         self._graph = nx.Graph(name=self.name)
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_metamolecu_2, __pyx_n_s_setGraph, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 207, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":219
 * 
 *     @Property
 *     def graph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         if self.invalid:
 *             self.setGraph()
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_graph_2, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 219, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":224
 *         return self._graph
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):             # <<<<<<<<<<<<<<
 *         """Look for the cycles in a molecule.
 *         """
 */
  __pyx_tuple__44 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_ordered, __pyx_n_s_asBond, __pyx_n_s_commonBonds, __pyx_n_s_res, __pyx_n_s_ind, __pyx_n_s_edges_attr, __pyx_n_s_dlst, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_keyinv, __pyx_n_s_res2, __pyx_n_s_lst, __pyx_n_s_loc, __pyx_n_s_bond, __pyx_n_s_res3, __pyx_n_s_clst, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_bb); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_cycles, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 224, __pyx_L1_error)
  __pyx_tuple__46 = PyTuple_Pack(3, ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "metaphor/chem_gm/core/metamolecule.py":263
 *         return res
 * 
 *     def closureCandidates(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         res = self.cycles(asBond=True, ordered=True)
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 */
  __pyx_tuple__47 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_res, __pyx_n_s_commonbonds, __pyx_n_s_resloc, __pyx_n_s_lst, __pyx_n_s_lstloc, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_closureCandidates, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 263, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":314
 * 
 * 
 *     def kekulize(self, action=False): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Transform an aromatic molecule to its Kekule representation
 *         !!!  To be checked  !!!
 */
  __pyx_tuple__49 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_action, __pyx_n_s_bondss, __pyx_n_s_atomss, __pyx_n_s_atoms, __pyx_n_s_bonds, __pyx_n_s_conds, __pyx_n_s_cond, __pyx_n_s_condbonds, __pyx_n_s_condbond, __pyx_n_s_atom, __pyx_n_s_ind, __pyx_n_s_bond, __pyx_n_s_type0, __pyx_n_s_type1, __pyx_n_s_atom, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_kekulize, 314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 314, __pyx_L1_error)
  __pyx_tuple__51 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "metaphor/chem_gm/core/metamolecule.py":355
 * 
 * 
 *     def remove(self, target): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove an atom from the molecule
 *         """
 */
  __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_remove, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 355, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":367
 *         self.invalid = True
 * 
 *     def normalizeNumeros(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(self.__smitokens):
 *             #if tok.numero > ind:
 */
  __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ind, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_normalizeNumeros, 367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 367, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":372
 *             tok._numero = ind
 * 
 *     def getBrokenBonds(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generator of the broken bonds in molecule
 *         """
 */
  __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_res, __pyx_n_s_tok, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getBrokenBonds, 372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 372, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */
  __pyx_tuple__59 = PyTuple_Pack(26, __pyx_n_s_self, __pyx_n_s_isoalgo, __pyx_n_s_fullH, __pyx_n_s_lst, __pyx_n_s_tok, __pyx_n_s_existingH, __pyx_n_s_missingH, __pyx_n_s__58, __pyx_n_s_Htok, __pyx_n_s_bond, __pyx_n_s_index, __pyx_n_s_holder, __pyx_n_s_rawisolist, __pyx_n_s_rawisogroups, __pyx_n_s_found, __pyx_n_s_tok2, __pyx_n_s_lsti, __pyx_n_s_isolatedindex, __pyx_n_s_ind, __pyx_n_s_cur, __pyx_n_s_iso_2, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_tok, __pyx_n_s_bond, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_postprocess, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 382, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":507
 * #         return weight
 * 
 *     def splitIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Splitting of concatenated iso groups.
 *         Example  "C/C(=N\OC(=O)NC)/SC"
 */
  __pyx_tuple__61 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_lst, __pyx_n_s_res, __pyx_n_s_dbllst, __pyx_n_s_ind, __pyx_n_s_tok, __pyx_n_s_last, __pyx_n_s_common, __pyx_n_s_pair); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_splitIsoGroup, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 507, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":535
 *         return res
 * 
 *     def ReduceIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove of exceeding iso groups.
 *         """
 */
  __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lst); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_ReduceIsoGroup, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 535, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":550
 *                     lst.pop(len(lst) -1)
 * 
 *     def mass(self):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Mass of the molecule
 *         """
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_mass, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 550, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":558
 *             return 0
 * 
 *     def printAll(self, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Print all the tokens
 *         """
 */
  __pyx_tuple__67 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_argv, __pyx_n_s_kwd, __pyx_n_s_writer); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_printAll, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 558, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */
  __pyx_tuple__69 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_ff, __pyx_n_s_argv, __pyx_n_s_kwd, __pyx_n_s_docycles, __pyx_n_s_tok, __pyx_n_s_bondss, __pyx_n_s_atomss, __pyx_n_s_bonds, __pyx_n_s_atoms, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_write, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 567, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":587
 * #                     ff.write("\n")
 * 
 *     def getdiff(self, target):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 */
  __pyx_tuple__71 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_tl, __pyx_n_s_ind, __pyx_n_s_t1, __pyx_n_s_t2, __pyx_n_s_st); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getdiff, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 587, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":596
 *         return "\n".join(tl)
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule             # <<<<<<<<<<<<<<
 *         atomlst = []
 *         atomoccur = []
 */
  __pyx_tuple__73 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_withoccurences, __pyx_n_s_atomlst, __pyx_n_s_atomoccur, __pyx_n_s_gradeoccur, __pyx_n_s_isooccur, __pyx_n_s_chiraloccur, __pyx_n_s_isomax, __pyx_n_s_chiralmax, __pyx_n_s_grade, __pyx_n_s_cyclelist, __pyx_n_s_chargelist, __pyx_n_s_occurs, __pyx_n_s_occurmols, __pyx_n_s_tok, __pyx_n_s_charge, __pyx_n_s_bond, __pyx_n_s_i, __pyx_n_s_key, __pyx_n_s_cycles); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_analyseinitiale, 596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 596, __pyx_L1_error)
  __pyx_tuple__75 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "metaphor/chem_gm/core/metamolecule.py":667
 * 
 * #-------------------------------------------------------------------------------
 *     def analyse(self, atoms=[], grade=0, iso=0, chiral=0, charge=0, occurs=None, occurmols=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Analysis of a token list.
 *         The purpose is to extract:
 */
  __pyx_tuple__76 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_atoms, __pyx_n_s_grade, __pyx_n_s_iso_2, __pyx_n_s_chiral, __pyx_n_s_charge, __pyx_n_s_occurs, __pyx_n_s_occurmols, __pyx_n_s_resloc, __pyx_n_s_gradeloc, __pyx_n_s_isoloc, __pyx_n_s_chiralloc, __pyx_n_s_occursloc, __pyx_n_s_occurmolsloc, __pyx_n_s_cycleloc, __pyx_n_s_chargelist, __pyx_n_s_val, __pyx_n_s_key, __pyx_n_s_val); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_analyse, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 667, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":707
 * 
 * #-------------------------------------------------------------------------------
 *     def computedistances(self, includebroken=False, maxiter=1000):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the distances in the molecule.
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_includebroken, __pyx_n_s_maxiter, __pyx_n_s_ll, __pyx_n_s_Madj, __pyx_n_s_MDist, __pyx_n_s_ind, __pyx_n_s_tok, __pyx_n_s_V, __pyx_n_s_bond, __pyx_n_s_index, __pyx_n_s_Mnadj, __pyx_n_s_test); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_computedistances, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 707, __pyx_L1_error)
  __pyx_tuple__80 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)__pyx_int_1000)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "metaphor/chem_gm/core/metamolecule.py":745
 * 
 * #-------------------------------------------------------------------------------
 *     def tallyDistanceIndexes(self, outputindex=0): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the class indexes of tokens.
 *         The algorithm of class computation is:
 */
  __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_outputindex, __pyx_n_s_cmax, __pyx_n_s_cmin, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_tallyDistanceIndexes, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 745, __pyx_L1_error)
  __pyx_tuple__83 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "metaphor/chem_gm/core/metamolecule.py":780
 * 
 * #-------------------------------------------------------------------------------
 *     def getChargeList(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrive the list of the charged tokens
 *         """
 */
  __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_lst, __pyx_n_s_tok, __pyx_n_s_val); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getChargeList, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 780, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */
  __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_cmax, __pyx_n_s_centraux, __pyx_n_s_tok, __pyx_n_s_i, __pyx_n_s_lst, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getCentralAtom, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 790, __pyx_L1_error)
  __pyx_tuple__88 = PyTuple_Pack(2, ((PyObject *)__pyx_int_0), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "metaphor/chem_gm/core/metamolecule.py":820
 * 
 * #-------------------------------------------------------------------------------
 *     def getskeleton(self, central, coupurecycles=1): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # cration du squelette du modle a partir du jeton central
 *         # C'est une liste de listes de jetons. Les sous listes sont classes par distance croissante avec le central
 */
  __pyx_tuple__89 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_central, __pyx_n_s_coupurecycles, __pyx_n_s_dmax, __pyx_n_s_skeleton, __pyx_n_s_cycleends, __pyx_n_s_last, __pyx_n_s_lst, __pyx_n_s_i, __pyx_n_s_tok, __pyx_n_s_tok2, __pyx_n_s_bond, __pyx_n_s_j, __pyx_n_s_tg1, __pyx_n_s_tg2, __pyx_n_s_bond1, __pyx_n_s_bond2, __pyx_n_s_elmt, __pyx_n_s_target, __pyx_n_s_ind, __pyx_n_s_index, __pyx_n_s_dist, __pyx_n_s_i, __pyx_n_s_ref); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getskeleton, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 820, __pyx_L1_error)
  __pyx_tuple__91 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "metaphor/chem_gm/core/metamolecule.py":884
 * 
 * #-------------------------------------------------------------------------------
 *     def atomgen(self, singleton=True): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 */
  __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_singleton, __pyx_n_s_already, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_atomgen, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_tuple__93 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "metaphor/chem_gm/core/metamolecule.py":895
 * 
 * #-------------------------------------------------------------------------------
 *     def clearModelBrokens(self):             # <<<<<<<<<<<<<<
 *         self._ringmodel = 0
 *         for bond in self.bonds():
 */
  __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_clearModelBrokens, 895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 895, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":900
 *             bond._modelbroken = 0
 * 
 *     def clearbrokens(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         for bond in self.bonds():
 */
  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_clearbrokens, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 900, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":905
 *             bond._broken = 0
 * 
 *     def recreatebrokenbonds(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Creation of closures for Smiles
 *         """
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_recreatebrokenbonds, 905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 905, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":915
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 *     def bonds(self):             # <<<<<<<<<<<<<<
 *         """generator of the bonds
 *         """
 */
  __pyx_tuple__100 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mem, __pyx_n_s_tok, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_bonds, 915, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 915, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":925
 *                     yield bond
 * 
 *     def ringClosureMax(self):             # <<<<<<<<<<<<<<
 *         val = 0
 *         for bond in self.bonds():
 */
  __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_val, __pyx_n_s_bond); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_ringClosureMax, 925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 925, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":934
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmilesStart(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         #return 0
 *         for tok in self.__smitokens:
 */
  __pyx_tuple__103 = PyTuple_Pack(23, __pyx_n_s_self, __pyx_n_s_tok, __pyx_n_s_dmaxlst, __pyx_n_s_dmmaxmax, __pyx_n_s_max_map, __pyx_n_s_terminals, __pyx_n_s_distsum, __pyx_n_s_distmax, __pyx_n_s_n, __pyx_n_s_sqyaredistsum, __pyx_n_s_squaredistmax, __pyx_n_s_blst, __pyx_n_s_singleterminals, __pyx_n_s_aromaticterm, __pyx_n_s_tok, __pyx_n_s_dmax, __pyx_n_s_ind, __pyx_n_s_ind, __pyx_n_s_tok, __pyx_n_s_tok, __pyx_n_s_bond, __pyx_n_s_tok, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getSmilesStart, 934, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 934, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":992
 * 
 * #-------------------------------------------------------------------------------
 *     def getEquivalents(self, target):# MetaMolecule             # <<<<<<<<<<<<<<
 *         outstyle = 0
 *         if isinstance(target, int):
 */
  __pyx_tuple__105 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_outstyle, __pyx_n_s_res, __pyx_n_s_tok, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getEquivalents, 992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 992, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1005
 *         return res
 * 
 *     def equivalentList(self, indexOnly=True):             # <<<<<<<<<<<<<<
 *         """return a list of lists.
 *         """
 */
  __pyx_tuple__107 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_indexOnly, __pyx_n_s_res, __pyx_n_s_counted, __pyx_n_s_tok, __pyx_n_s_lst, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_equivalentList, 1005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __pyx_tuple__109 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "metaphor/chem_gm/core/metamolecule.py":1023
 * 
 * #-------------------------------------------------------------------------------
 *     def getReducedList(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Get the list of tokens excluding the equivalent tokens
 *         """
 */
  __pyx_tuple__110 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_res, __pyx_n_s_excluded, __pyx_n_s_tok, __pyx_n_s_equiv); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getReducedList, 1023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 1023, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1036
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmiles(self, isomeric=False, withIndList=False, withname=False, fullH=False, itermax=0, special=[]):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generate a SMILES of the molecule
 *         Inputs:
 */
  __pyx_tuple__112 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_isomeric, __pyx_n_s_withIndList, __pyx_n_s_withname, __pyx_n_s_fullH, __pyx_n_s_itermax, __pyx_n_s_special, __pyx_n_s_tok, __pyx_n_s_ind, __pyx_n_s_level, __pyx_n_s_data, __pyx_n_s_indList, __pyx_n_s_startindex, __pyx_n_s__58, __pyx_n_s_cumul, __pyx_n_s_moltest, __pyx_n_s_datatest, __pyx_n_s_indListTest, __pyx_n_s_indListmem, __pyx_n_s_val); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(7, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_getSmiles, 1036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 1036, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1090
 * # end of class MetaMolecule
 * #-------------------------------------------------------------------------------
 * def adj2dist(Mnadj, MDist, ind, ll):             # <<<<<<<<<<<<<<
 *     res = True
 *     for i in range(ll):
 */
  __pyx_tuple__114 = PyTuple_Pack(7, __pyx_n_s_Mnadj, __pyx_n_s_MDist, __pyx_n_s_ind, __pyx_n_s_ll, __pyx_n_s_res, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_adj2dist, 1090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1090, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1101
 * 
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):             # <<<<<<<<<<<<<<
 *     try:
 *         MetaMolecule(value)
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_isSmiles, 1101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 1101, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1108
 *         return False
 * 
 * def isInt(val):             # <<<<<<<<<<<<<<
 *     try:
 *         int(val)
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_n_s_val); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_metaphor_chem_gm_core_metamolecu_2, __pyx_n_s_isInt, 1108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1108, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":1153
 * #     for token in mol:
 * #         print(token)
 *     print('done')             # <<<<<<<<<<<<<<
 * 
 * #     print("running smi_parser\n")
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_u_done); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyList_Type_count.type = (PyObject*)&PyList_Type;
  __pyx_umethod_PyList_Type_index.type = (PyObject*)&PyList_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_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_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8593 = PyInt_FromLong(8593); if (unlikely(!__pyx_int_8593)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_36863 = PyInt_FromLong(36863L); if (unlikely(!__pyx_int_36863)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_modinit_global_init_code(void); /*proto*/
static int __Pyx_modinit_variable_export_code(void); /*proto*/
static int __Pyx_modinit_function_export_code(void); /*proto*/
static int __Pyx_modinit_type_init_code(void); /*proto*/
static int __Pyx_modinit_type_import_code(void); /*proto*/
static int __Pyx_modinit_variable_import_code(void); /*proto*/
static int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct__addClassToSmiles;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_2_postprocess;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_3_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_4_write;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom) < 0) __PYX_ERR(0, 790, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_7_getCentralAtom;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 804, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_9_atomgen;
  if (PyType_Ready(&__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds) < 0) __PYX_ERR(0, 915, __pyx_L1_error)
  __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds.tp_dictoffset && __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds = &__pyx_type_8metaphor_7chem_gm_4core_12metamolecule___pyx_scope_struct_10_bonds;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initmetamolecule(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initmetamolecule(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_metamolecule(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_metamolecule(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_metamolecule(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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  __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_metamolecule(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("metamolecule", __pyx_methods, __pyx_k_Definition_of_MetaMolecule_clas, 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__metamolecule) {
    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.metamolecule")) {
      if (unlikely(PyDict_SetItemString(modules, "metaphor.chem_gm.core.metamolecule", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "metaphor/chem_gm/core/metamolecule.py":26
 * 
 * '''
 * import sys, os             # <<<<<<<<<<<<<<
 * import six
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":27
 * '''
 * import sys, os
 * import six             # <<<<<<<<<<<<<<
 * import numpy as np
 * from itertools import islice
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, 0, 0); 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_six, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":28
 * import sys, os
 * import six
 * import numpy as np             # <<<<<<<<<<<<<<
 * from itertools import islice
 * import networkx as nx
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":29
 * import six
 * import numpy as np
 * from itertools import islice             # <<<<<<<<<<<<<<
 * import networkx as nx
 * from collections import defaultdict
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_islice);
  __Pyx_GIVEREF(__pyx_n_s_islice);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_islice);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __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_islice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_islice, __pyx_t_1) < 0) __PYX_ERR(0, 29, __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/metamolecule.py":30
 * import numpy as np
 * from itertools import islice
 * import networkx as nx             # <<<<<<<<<<<<<<
 * from collections import defaultdict
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":31
 * from itertools import islice
 * import networkx as nx
 * from collections import defaultdict             # <<<<<<<<<<<<<<
 * 
 * from ...monal.Property import delegate, Property
 */
  __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_defaultdict);
  __Pyx_GIVEREF(__pyx_n_s_defaultdict);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_defaultdict);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); 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_defaultdict); 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_defaultdict, __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/metamolecule.py":33
 * from collections import defaultdict
 * 
 * from ...monal.Property import delegate, Property             # <<<<<<<<<<<<<<
 * from ...chem_gm import gmconstants as GC
 * from ...chem_gm.core import smiparserspec
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_delegate);
  __Pyx_GIVEREF(__pyx_n_s_delegate);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_delegate);
  __Pyx_INCREF(__pyx_n_s_Property);
  __Pyx_GIVEREF(__pyx_n_s_Property);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Property);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_monal_Property, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __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_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delegate, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Property); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Property, __pyx_t_1) < 0) __PYX_ERR(0, 33, __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/metamolecule.py":34
 * 
 * from ...monal.Property import delegate, Property
 * from ...chem_gm import gmconstants as GC             # <<<<<<<<<<<<<<
 * from ...chem_gm.core import smiparserspec
 * try:
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_gmconstants);
  __Pyx_GIVEREF(__pyx_n_s_gmconstants);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gmconstants);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_chem_gm, __pyx_t_2, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __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_gmconstants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GC, __pyx_t_2) < 0) __PYX_ERR(0, 34, __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/metamolecule.py":35
 * from ...monal.Property import delegate, Property
 * from ...chem_gm import gmconstants as GC
 * from ...chem_gm.core import smiparserspec             # <<<<<<<<<<<<<<
 * try:
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_smiparserspec);
  __Pyx_GIVEREF(__pyx_n_s_smiparserspec);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_smiparserspec);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_chem_gm_core, __pyx_t_1, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_smiparserspec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_smiparserspec, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":36
 * from ...chem_gm import gmconstants as GC
 * from ...chem_gm.core import smiparserspec
 * try:             # <<<<<<<<<<<<<<
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 *     from .smitokens import SmiToken, tokenKeyValue
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "metaphor/chem_gm/core/metamolecule.py":37
 * from ...chem_gm.core import smiparserspec
 * try:
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z             # <<<<<<<<<<<<<<
 *     from .smitokens import SmiToken, tokenKeyValue
 *     from .gmutils import findinlist, gradekey, isokey, chikey, chargekey
 */
      __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_SmiError);
      __Pyx_GIVEREF(__pyx_n_s_SmiError);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SmiError);
      __Pyx_INCREF(__pyx_n_s_keyAtoms);
      __Pyx_GIVEREF(__pyx_n_s_keyAtoms);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_keyAtoms);
      __Pyx_INCREF(__pyx_n_s_Hydrogenes);
      __Pyx_GIVEREF(__pyx_n_s_Hydrogenes);
      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Hydrogenes);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_atoms, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SmiError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiError, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_keyAtoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyAtoms, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Hydrogenes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hydrogenes, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":38
 * try:
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 *     from .smitokens import SmiToken, tokenKeyValue             # <<<<<<<<<<<<<<
 *     from .gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from .smitokens import keyForChiral, _12absolute
 */
      __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L2_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_INCREF(__pyx_n_s_tokenKeyValue);
      __Pyx_GIVEREF(__pyx_n_s_tokenKeyValue);
      PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tokenKeyValue);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_smitokens, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L2_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, 38, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiToken, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tokenKeyValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_tokenKeyValue, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":39
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 *     from .smitokens import SmiToken, tokenKeyValue
 *     from .gmutils import findinlist, gradekey, isokey, chikey, chargekey             # <<<<<<<<<<<<<<
 *     from .smitokens import keyForChiral, _12absolute
 *     from .bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 */
      __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_findinlist);
      __Pyx_GIVEREF(__pyx_n_s_findinlist);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_findinlist);
      __Pyx_INCREF(__pyx_n_s_gradekey);
      __Pyx_GIVEREF(__pyx_n_s_gradekey);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gradekey);
      __Pyx_INCREF(__pyx_n_s_isokey);
      __Pyx_GIVEREF(__pyx_n_s_isokey);
      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_isokey);
      __Pyx_INCREF(__pyx_n_s_chikey);
      __Pyx_GIVEREF(__pyx_n_s_chikey);
      PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_chikey);
      __Pyx_INCREF(__pyx_n_s_chargekey);
      __Pyx_GIVEREF(__pyx_n_s_chargekey);
      PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_chargekey);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_gmutils, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_findinlist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_findinlist, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_gradekey); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradekey, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_isokey); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_isokey, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_chikey); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_chikey, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_chargekey); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_chargekey, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":40
 *     from .smitokens import SmiToken, tokenKeyValue
 *     from .gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from .smitokens import keyForChiral, _12absolute             # <<<<<<<<<<<<<<
 *     from .bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * except:
 */
      __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_keyForChiral);
      __Pyx_GIVEREF(__pyx_n_s_keyForChiral);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_keyForChiral);
      __Pyx_INCREF(__pyx_n_s_12absolute);
      __Pyx_GIVEREF(__pyx_n_s_12absolute);
      PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_12absolute);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_smitokens, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L2_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_keyForChiral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyForChiral, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_12absolute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_12absolute, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":41
 *     from .gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from .smitokens import keyForChiral, _12absolute
 *     from .bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure             # <<<<<<<<<<<<<<
 * except:
 *     from ...chem_gm.core.atoms import SmiError, keyAtoms #,compareAtoms  #, Z
 */
      __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_SINGLE_BOND);
      __Pyx_GIVEREF(__pyx_n_s_SINGLE_BOND);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SINGLE_BOND);
      __Pyx_INCREF(__pyx_n_s_AROMATIC_BOND);
      __Pyx_GIVEREF(__pyx_n_s_AROMATIC_BOND);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_AROMATIC_BOND);
      __Pyx_INCREF(__pyx_n_s_DOUBLE_BOND);
      __Pyx_GIVEREF(__pyx_n_s_DOUBLE_BOND);
      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_DOUBLE_BOND);
      __Pyx_INCREF(__pyx_n_s_keyForClosure);
      __Pyx_GIVEREF(__pyx_n_s_keyForClosure);
      PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_keyForClosure);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_bonds, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SINGLE_BOND, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_AROMATIC_BOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROMATIC_BOND, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_DOUBLE_BOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE_BOND, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_keyForClosure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyForClosure, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":36
 * from ...chem_gm import gmconstants as GC
 * from ...chem_gm.core import smiparserspec
 * try:             # <<<<<<<<<<<<<<
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 *     from .smitokens import SmiToken, tokenKeyValue
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":42
 *     from .smitokens import keyForChiral, _12absolute
 *     from .bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * except:             # <<<<<<<<<<<<<<
 *     from ...chem_gm.core.atoms import SmiError, keyAtoms #,compareAtoms  #, Z
 *     from ...chem_gm.core.smitokens import SmiToken
 */
    /*except:*/ {
      __Pyx_AddTraceback("metaphor.chem_gm.core.metamolecule", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(0, 42, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_6);

      /* "metaphor/chem_gm/core/metamolecule.py":43
 *     from .bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * except:
 *     from ...chem_gm.core.atoms import SmiError, keyAtoms #,compareAtoms  #, Z             # <<<<<<<<<<<<<<
 *     from ...chem_gm.core.smitokens import SmiToken
 *     from ...chem_gm.core.gmutils import findinlist, gradekey, isokey, chikey, chargekey
 */
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_SmiError);
      __Pyx_GIVEREF(__pyx_n_s_SmiError);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_SmiError);
      __Pyx_INCREF(__pyx_n_s_keyAtoms);
      __Pyx_GIVEREF(__pyx_n_s_keyAtoms);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_keyAtoms);
      __pyx_t_8 = __Pyx_Import(__pyx_n_s_chem_gm_core_atoms, __pyx_t_7, 3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_SmiError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiError, __pyx_t_7) < 0) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_keyAtoms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyAtoms, __pyx_t_7) < 0) __PYX_ERR(0, 43, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":44
 * except:
 *     from ...chem_gm.core.atoms import SmiError, keyAtoms #,compareAtoms  #, Z
 *     from ...chem_gm.core.smitokens import SmiToken             # <<<<<<<<<<<<<<
 *     from ...chem_gm.core.gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from ...chem_gm.core.smitokens import keyForChiral, _12absolute
 */
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_n_s_SmiToken);
      __Pyx_GIVEREF(__pyx_n_s_SmiToken);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_SmiToken);
      __pyx_t_7 = __Pyx_Import(__pyx_n_s_chem_gm_core_smitokens, __pyx_t_8, 3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_SmiToken); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmiToken, __pyx_t_8) < 0) __PYX_ERR(0, 44, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":45
 *     from ...chem_gm.core.atoms import SmiError, keyAtoms #,compareAtoms  #, Z
 *     from ...chem_gm.core.smitokens import SmiToken
 *     from ...chem_gm.core.gmutils import findinlist, gradekey, isokey, chikey, chargekey             # <<<<<<<<<<<<<<
 *     from ...chem_gm.core.smitokens import keyForChiral, _12absolute
 *     from ...chem_gm.core.bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 */
      __pyx_t_7 = PyList_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_findinlist);
      __Pyx_GIVEREF(__pyx_n_s_findinlist);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_findinlist);
      __Pyx_INCREF(__pyx_n_s_gradekey);
      __Pyx_GIVEREF(__pyx_n_s_gradekey);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_gradekey);
      __Pyx_INCREF(__pyx_n_s_isokey);
      __Pyx_GIVEREF(__pyx_n_s_isokey);
      PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_isokey);
      __Pyx_INCREF(__pyx_n_s_chikey);
      __Pyx_GIVEREF(__pyx_n_s_chikey);
      PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_chikey);
      __Pyx_INCREF(__pyx_n_s_chargekey);
      __Pyx_GIVEREF(__pyx_n_s_chargekey);
      PyList_SET_ITEM(__pyx_t_7, 4, __pyx_n_s_chargekey);
      __pyx_t_8 = __Pyx_Import(__pyx_n_s_chem_gm_core_gmutils, __pyx_t_7, 3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_findinlist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_findinlist, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_gradekey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradekey, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_isokey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_isokey, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_chikey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_chikey, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_chargekey); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_chargekey, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":46
 *     from ...chem_gm.core.smitokens import SmiToken
 *     from ...chem_gm.core.gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from ...chem_gm.core.smitokens import keyForChiral, _12absolute             # <<<<<<<<<<<<<<
 *     from ...chem_gm.core.bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * from  . import smilexer as smilex
 */
      __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_n_s_keyForChiral);
      __Pyx_GIVEREF(__pyx_n_s_keyForChiral);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_keyForChiral);
      __Pyx_INCREF(__pyx_n_s_12absolute);
      __Pyx_GIVEREF(__pyx_n_s_12absolute);
      PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_12absolute);
      __pyx_t_7 = __Pyx_Import(__pyx_n_s_chem_gm_core_smitokens, __pyx_t_8, 3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_keyForChiral); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyForChiral, __pyx_t_8) < 0) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_12absolute); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_12absolute, __pyx_t_8) < 0) __PYX_ERR(0, 46, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":47
 *     from ...chem_gm.core.gmutils import findinlist, gradekey, isokey, chikey, chargekey
 *     from ...chem_gm.core.smitokens import keyForChiral, _12absolute
 *     from ...chem_gm.core.bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure             # <<<<<<<<<<<<<<
 * from  . import smilexer as smilex
 * from ..components import lex
 */
      __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_SINGLE_BOND);
      __Pyx_GIVEREF(__pyx_n_s_SINGLE_BOND);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_SINGLE_BOND);
      __Pyx_INCREF(__pyx_n_s_AROMATIC_BOND);
      __Pyx_GIVEREF(__pyx_n_s_AROMATIC_BOND);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_AROMATIC_BOND);
      __Pyx_INCREF(__pyx_n_s_DOUBLE_BOND);
      __Pyx_GIVEREF(__pyx_n_s_DOUBLE_BOND);
      PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_DOUBLE_BOND);
      __Pyx_INCREF(__pyx_n_s_keyForClosure);
      __Pyx_GIVEREF(__pyx_n_s_keyForClosure);
      PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_keyForClosure);
      __pyx_t_8 = __Pyx_Import(__pyx_n_s_chem_gm_core_bonds, __pyx_t_7, 3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_SINGLE_BOND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SINGLE_BOND, __pyx_t_7) < 0) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_AROMATIC_BOND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_AROMATIC_BOND, __pyx_t_7) < 0) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_DOUBLE_BOND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE_BOND, __pyx_t_7) < 0) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_keyForClosure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyForClosure, __pyx_t_7) < 0) __PYX_ERR(0, 47, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L3_exception_handled;
    }
    __pyx_L4_except_error:;

    /* "metaphor/chem_gm/core/metamolecule.py":36
 * from ...chem_gm import gmconstants as GC
 * from ...chem_gm.core import smiparserspec
 * try:             # <<<<<<<<<<<<<<
 *     from .atoms import SmiError, keyAtoms, Hydrogenes#, compareAtoms  #, Z
 *     from .smitokens import SmiToken, tokenKeyValue
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L7_try_end:;
  }

  /* "metaphor/chem_gm/core/metamolecule.py":48
 *     from ...chem_gm.core.smitokens import keyForChiral, _12absolute
 *     from ...chem_gm.core.bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * from  . import smilexer as smilex             # <<<<<<<<<<<<<<
 * from ..components import lex
 * from ..components import yacc
 */
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_smilexer);
  __Pyx_GIVEREF(__pyx_n_s_smilexer);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_smilexer);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_, __pyx_t_6, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_smilexer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_smilex, __pyx_t_6) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":49
 *     from ...chem_gm.core.bonds import SINGLE_BOND, AROMATIC_BOND, DOUBLE_BOND, keyForClosure
 * from  . import smilexer as smilex
 * from ..components import lex             # <<<<<<<<<<<<<<
 * from ..components import yacc
 * from ...monal.util.utils import appdatadir
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_lex);
  __Pyx_GIVEREF(__pyx_n_s_lex);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lex);
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_components, __pyx_t_2, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_lex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lex, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":50
 * from  . import smilexer as smilex
 * from ..components import lex
 * from ..components import yacc             # <<<<<<<<<<<<<<
 * from ...monal.util.utils import appdatadir
 * from ...monal.util.toolbox import raw
 */
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_yacc);
  __Pyx_GIVEREF(__pyx_n_s_yacc);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_yacc);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_components, __pyx_t_6, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_yacc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_yacc, __pyx_t_6) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":51
 * from ..components import lex
 * from ..components import yacc
 * from ...monal.util.utils import appdatadir             # <<<<<<<<<<<<<<
 * from ...monal.util.toolbox import raw
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_appdatadir);
  __Pyx_GIVEREF(__pyx_n_s_appdatadir);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_appdatadir);
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_monal_util_utils, __pyx_t_2, 3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_appdatadir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_appdatadir, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":52
 * from ..components import yacc
 * from ...monal.util.utils import appdatadir
 * from ...monal.util.toolbox import raw             # <<<<<<<<<<<<<<
 * 
 * OKDraw = False
 */
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_s_raw);
  __Pyx_GIVEREF(__pyx_n_s_raw);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_raw);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_monal_util_toolbox, __pyx_t_6, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_raw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_raw, __pyx_t_6) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":54
 * from ...monal.util.toolbox import raw
 * 
 * OKDraw = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OKDraw, Py_False) < 0) __PYX_ERR(0, 54, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":58
 * 
 * 
 * isoalgodefault = GC.ISOALGO_PAIR             # <<<<<<<<<<<<<<
 * setH = 0
 * verbose = 0
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_GC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ISOALGO_PAIR); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isoalgodefault, __pyx_t_6) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":59
 * 
 * isoalgodefault = GC.ISOALGO_PAIR
 * setH = 0             # <<<<<<<<<<<<<<
 * verbose = 0
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setH, __pyx_int_0) < 0) __PYX_ERR(0, 59, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":60
 * isoalgodefault = GC.ISOALGO_PAIR
 * setH = 0
 * verbose = 0             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_verbose, __pyx_int_0) < 0) __PYX_ERR(0, 60, __pyx_L1_error)

  /* "metaphor/chem_gm/core/metamolecule.py":63
 * 
 * #-------------------------------------------------------------------------------
 * class SmiCycleError(SmiError):             # <<<<<<<<<<<<<<
 *     """Exception in cycle analysis
 *     """
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_n_s_iso885915_SmiCycleError, __pyx_n_s_SmiCycleError, (PyObject *) NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_kp_s_Exception_in_cycle_analysis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_iso885915_SmiCycleError, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iso885915_SmiCycleError, __pyx_t_8) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":68
 *     pass
 * 
 * class SmileParserError(SmiError):             # <<<<<<<<<<<<<<
 *     """Exception in SMILES parsing
 *     """
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SmiError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_6, __pyx_n_s_iso885915_SmileParserError, __pyx_n_s_SmileParserError, (PyObject *) NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_kp_s_Exception_in_SMILES_parsing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "metaphor/chem_gm/core/metamolecule.py":71
 *     """Exception in SMILES parsing
 *     """
 *     def __init__(self, message="Smiles parser Error", smiles="", sequence="", lexline=None, lexpos=None, modelname=""):             # <<<<<<<<<<<<<<
 *         super(SmileParserError, self).__init__(message)
 *         self.smiles = smiles
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_1__init__, 0, __pyx_n_s_SmileParserError___init, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__26);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":87
 *                 self.message = "%s, name: %s"%(self.message, modelname)
 * 
 *     @Property             # <<<<<<<<<<<<<<
 *     def msg(self):
 *         if not self.smiles:
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "metaphor/chem_gm/core/metamolecule.py":88
 * 
 *     @Property
 *     def msg(self):             # <<<<<<<<<<<<<<
 *         if not self.smiles:
 *             return self.message
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_16SmileParserError_3msg, 0, __pyx_n_s_SmileParserError_msg, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_msg, __pyx_t_8) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":68
 *     pass
 * 
 * class SmileParserError(SmiError):             # <<<<<<<<<<<<<<
 *     """Exception in SMILES parsing
 *     """
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_iso885915_SmileParserError, __pyx_t_6, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iso885915_SmileParserError, __pyx_t_8) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":100
 * 
 * #-------------------------------------------------------------------------------
 * def SmilesToCanonic(source, isomeric=False, kekulize=0, indexlist=False, withname=False, fullH=False, itermax=0):             # <<<<<<<<<<<<<<
 *     """Convert a SMILES to a canonic SMILES
 *     """
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_1SmilesToCanonic, 0, __pyx_n_s_SmilesToCanonic, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__31);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SmilesToCanonic, __pyx_t_6) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":124
 *     return res
 * 
 * def stabilizeSmiles(source, isomeric=False, indexlist=False, withname=False, fullH=False, itermax=10):             # <<<<<<<<<<<<<<
 *     """Gives a stable SMILES
 *     """
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_3stabilizeSmiles, 0, __pyx_n_s_stabilizeSmiles, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__34);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stabilizeSmiles, __pyx_t_6) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":129
 *     return MetaMolecule(source, fullH=fullH).getSmiles(isomeric=isomeric, withIndList=indexlist, fullH=fullH, itermax=itermax)
 * 
 * def addClassToSmiles(source, markatom=["C"], data=1, prefix=0, reduced=False, fullH=False, withindex=False):             # <<<<<<<<<<<<<<
 *     if isinstance(markatom, str):
 *         markatom = [markatom]
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_5addClassToSmiles, 0, __pyx_n_s_addClassToSmiles, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 129, __pyx_L1_error)
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_u_C);
  __Pyx_GIVEREF(__pyx_n_u_C);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_C);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_6)->__pyx_arg_markatom = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_12__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_addClassToSmiles, __pyx_t_6) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":160
 * @delegate(["__smitokens", '__delitem__', "__getitem__", "__setitem__", "__iter__",
 *            "__reversed__", "__len__", "__str__", "pop", "append", "insert"])
 * class MetaMolecule(object):  # ex tokenlist             # <<<<<<<<<<<<<<
 *     """class MetaMolecule.
 *     This class uses the PLY based lexer and parser.
 */
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__37); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__37, __pyx_n_s_iso885915_MetaMolecule, __pyx_n_s_MetaMolecule, (PyObject *) NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_kp_s_class_MetaMolecule_This_class_us); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "metaphor/chem_gm/core/metamolecule.py":180
 * #     - insert
 * 
 *     def __init__(self, smiles, name="", isoalgo=isoalgodefault, fullH=setH):             # <<<<<<<<<<<<<<
 *         '''MetaMolecule constructor
 *         '''
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_1__init__, 0, __pyx_n_s_MetaMolecule___init, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 2)) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_isoalgodefault); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_isoalgo = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_setH); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_fullH = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_14__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":207
 *         self.invalid = True
 * 
 *     def setGraph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         self._graph = nx.Graph(name=self.name)
 *         #weightedBondList = ((bond.atoms()[0], bond.atoms()[1], bond.bondOrder) for bond in  self.bonds())
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_3setGraph, 0, __pyx_n_s_MetaMolecule_setGraph, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setGraph, __pyx_t_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":218
 *         return self.graph
 * 
 *     @Property             # <<<<<<<<<<<<<<
 *     def graph(self): #MetaMolecule
 *         if self.invalid:
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "metaphor/chem_gm/core/metamolecule.py":219
 * 
 *     @Property
 *     def graph(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         if self.invalid:
 *             self.setGraph()
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_5graph, 0, __pyx_n_s_MetaMolecule_graph, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_11) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __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, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11); __pyx_t_11 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_graph_2, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":224
 *         return self._graph
 * 
 *     def cycles(self, ordered=False, asBond=False, commonBonds=False): #MetaMolecule    #, ordered=False):             # <<<<<<<<<<<<<<
 *         """Look for the cycles in a molecule.
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_7cycles, 0, __pyx_n_s_MetaMolecule_cycles, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__46);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_cycles, __pyx_t_1) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":263
 *         return res
 * 
 *     def closureCandidates(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         res = self.cycles(asBond=True, ordered=True)
 *         # Chaque element de res est une liste de liaisons incluses dans un cycle
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_9closureCandidates, 0, __pyx_n_s_MetaMolecule_closureCandidates, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closureCandidates, __pyx_t_1) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":314
 * 
 * 
 *     def kekulize(self, action=False): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Transform an aromatic molecule to its Kekule representation
 *         !!!  To be checked  !!!
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_11kekulize, 0, __pyx_n_s_MetaMolecule_kekulize, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__51);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_kekulize, __pyx_t_1) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":355
 * 
 * 
 *     def remove(self, target): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove an atom from the molecule
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_13remove, 0, __pyx_n_s_MetaMolecule_remove, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove, __pyx_t_1) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":367
 *         self.invalid = True
 * 
 *     def normalizeNumeros(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         for ind, tok in enumerate(self.__smitokens):
 *             #if tok.numero > ind:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_15normalizeNumeros, 0, __pyx_n_s_MetaMolecule_normalizeNumeros, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_normalizeNumeros, __pyx_t_1) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":372
 *             tok._numero = ind
 * 
 *     def getBrokenBonds(self): #MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generator of the broken bonds in molecule
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_17getBrokenBonds, 0, __pyx_n_s_MetaMolecule_getBrokenBonds, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getBrokenBonds, __pyx_t_1) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":382
 *         return res
 * 
 *     def postprocess(self, isoalgo=GC.ISOALGO_0, fullH=False):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         self.invalid = True
 *         # normalisation des chiral
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_19postprocess, 0, __pyx_n_s_MetaMolecule_postprocess, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 382, __pyx_L1_error)
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_GC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ISOALGO_0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_isoalgo = __pyx_t_9;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_16__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postprocess, __pyx_t_1) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":507
 * #         return weight
 * 
 *     def splitIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Splitting of concatenated iso groups.
 *         Example  "C/C(=N\OC(=O)NC)/SC"
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_21splitIsoGroup, 0, __pyx_n_s_MetaMolecule_splitIsoGroup, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_splitIsoGroup, __pyx_t_1) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":535
 *         return res
 * 
 *     def ReduceIsoGroup(self, lst):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Remove of exceeding iso groups.
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_23ReduceIsoGroup, 0, __pyx_n_s_MetaMolecule_ReduceIsoGroup, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ReduceIsoGroup, __pyx_t_1) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":550
 *                     lst.pop(len(lst) -1)
 * 
 *     def mass(self):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Mass of the molecule
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_25mass, 0, __pyx_n_s_MetaMolecule_mass, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_mass, __pyx_t_1) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":558
 *             return 0
 * 
 *     def printAll(self, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Print all the tokens
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_27printAll, 0, __pyx_n_s_MetaMolecule_printAll, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_printAll, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":567
 *         return self.write(writer, *argv, **kwd)
 * 
 *     def write(self, ff, *argv, **kwd):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         docycles = kwd.pop("cycles", False)
 *         if self.name:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_29write, 0, __pyx_n_s_MetaMolecule_write, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":587
 * #                     ff.write("\n")
 * 
 *     def getdiff(self, target):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         tl = []
 *         for ind, (t1, t2) in enumerate(zip(self, target)):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_31getdiff, 0, __pyx_n_s_MetaMolecule_getdiff, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getdiff, __pyx_t_1) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":596
 *         return "\n".join(tl)
 * 
 *     def _analyseinitiale(self, withoccurences=False): # MetaMolecule             # <<<<<<<<<<<<<<
 *         atomlst = []
 *         atomoccur = []
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_33_analyseinitiale, 0, __pyx_n_s_MetaMolecule__analyseinitiale, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__75);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_analyseinitiale, __pyx_t_1) < 0) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":667
 * 
 * #-------------------------------------------------------------------------------
 *     def analyse(self, atoms=[], grade=0, iso=0, chiral=0, charge=0, occurs=None, occurmols=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Analysis of a token list.
 *         The purpose is to extract:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_35analyse, 0, __pyx_n_s_MetaMolecule_analyse, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_atoms = __pyx_t_9;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_18__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_analyse, __pyx_t_1) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":707
 * 
 * #-------------------------------------------------------------------------------
 *     def computedistances(self, includebroken=False, maxiter=1000):  # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the distances in the molecule.
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_37computedistances, 0, __pyx_n_s_MetaMolecule_computedistances, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__80);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_computedistances, __pyx_t_1) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":745
 * 
 * #-------------------------------------------------------------------------------
 *     def tallyDistanceIndexes(self, outputindex=0): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Compute the class indexes of tokens.
 *         The algorithm of class computation is:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_39tallyDistanceIndexes, 0, __pyx_n_s_MetaMolecule_tallyDistanceIndexe, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__83);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tallyDistanceIndexes, __pyx_t_1) < 0) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":780
 * 
 * #-------------------------------------------------------------------------------
 *     def getChargeList(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrive the list of the charged tokens
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_41getChargeList, 0, __pyx_n_s_MetaMolecule_getChargeList, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getChargeList, __pyx_t_1) < 0) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":790
 *         return lst
 * #-------------------------------------------------------------------------------
 *     def getCentralAtom(self, cmax=0, centraux=None): # MetaMolecule             # <<<<<<<<<<<<<<
 *         """Retrieve the root atom of the molecule
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_43getCentralAtom, 0, __pyx_n_s_MetaMolecule_getCentralAtom, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__88);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCentralAtom, __pyx_t_1) < 0) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":820
 * 
 * #-------------------------------------------------------------------------------
 *     def getskeleton(self, central, coupurecycles=1): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # cration du squelette du modle a partir du jeton central
 *         # C'est une liste de listes de jetons. Les sous listes sont classes par distance croissante avec le central
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_45getskeleton, 0, __pyx_n_s_MetaMolecule_getskeleton, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__91);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getskeleton, __pyx_t_1) < 0) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":884
 * 
 * #-------------------------------------------------------------------------------
 *     def atomgen(self, singleton=True): # MetaMolecule             # <<<<<<<<<<<<<<
 *         # gnrateur des symboles atomiques de la liste de jetons
 *         already = []
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_47atomgen, 0, __pyx_n_s_MetaMolecule_atomgen, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__93);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_atomgen, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":895
 * 
 * #-------------------------------------------------------------------------------
 *     def clearModelBrokens(self):             # <<<<<<<<<<<<<<
 *         self._ringmodel = 0
 *         for bond in self.bonds():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_50clearModelBrokens, 0, __pyx_n_s_MetaMolecule_clearModelBrokens, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_clearModelBrokens, __pyx_t_1) < 0) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":900
 *             bond._modelbroken = 0
 * 
 *     def clearbrokens(self): # MetaMolecule             # <<<<<<<<<<<<<<
 *         self._ringsmiles = 0
 *         for bond in self.bonds():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_52clearbrokens, 0, __pyx_n_s_MetaMolecule_clearbrokens, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_clearbrokens, __pyx_t_1) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":905
 *             bond._broken = 0
 * 
 *     def recreatebrokenbonds(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Creation of closures for Smiles
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_54recreatebrokenbonds, 0, __pyx_n_s_MetaMolecule_recreatebrokenbonds, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_recreatebrokenbonds, __pyx_t_1) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":915
 *         self.__smitokens[0].populatebrokenbonds(self)
 * 
 *     def bonds(self):             # <<<<<<<<<<<<<<
 *         """generator of the bonds
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_56bonds, 0, __pyx_n_s_MetaMolecule_bonds, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_bonds, __pyx_t_1) < 0) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":925
 *                     yield bond
 * 
 *     def ringClosureMax(self):             # <<<<<<<<<<<<<<
 *         val = 0
 *         for bond in self.bonds():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_59ringClosureMax, 0, __pyx_n_s_MetaMolecule_ringClosureMax, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ringClosureMax, __pyx_t_1) < 0) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":934
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmilesStart(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         #return 0
 *         for tok in self.__smitokens:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_61getSmilesStart, 0, __pyx_n_s_MetaMolecule_getSmilesStart, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSmilesStart, __pyx_t_1) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":992
 * 
 * #-------------------------------------------------------------------------------
 *     def getEquivalents(self, target):# MetaMolecule             # <<<<<<<<<<<<<<
 *         outstyle = 0
 *         if isinstance(target, int):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_63getEquivalents, 0, __pyx_n_s_MetaMolecule_getEquivalents, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getEquivalents, __pyx_t_1) < 0) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1005
 *         return res
 * 
 *     def equivalentList(self, indexOnly=True):             # <<<<<<<<<<<<<<
 *         """return a list of lists.
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_65equivalentList, 0, __pyx_n_s_MetaMolecule_equivalentList, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__109);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_equivalentList, __pyx_t_1) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1023
 * 
 * #-------------------------------------------------------------------------------
 *     def getReducedList(self):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Get the list of tokens excluding the equivalent tokens
 *         """
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_67getReducedList, 0, __pyx_n_s_MetaMolecule_getReducedList, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getReducedList, __pyx_t_1) < 0) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1036
 * 
 * #-------------------------------------------------------------------------------
 *     def getSmiles(self, isomeric=False, withIndList=False, withname=False, fullH=False, itermax=0, special=[]):# MetaMolecule             # <<<<<<<<<<<<<<
 *         """Generate a SMILES of the molecule
 *         Inputs:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_12MetaMolecule_69getSmiles, 0, __pyx_n_s_MetaMolecule_getSmiles, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_special = __pyx_t_9;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8metaphor_7chem_gm_4core_12metamolecule_20__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSmiles, __pyx_t_1) < 0) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1086
 *         return self.name, data, indList
 * 
 *     toSmiles = getSmiles             # <<<<<<<<<<<<<<
 * 
 * # end of class MetaMolecule
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_getSmiles);
  if (unlikely(!__pyx_t_1)) {
    PyErr_Clear();
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getSmiles);
  }
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toSmiles, __pyx_t_1) < 0) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":158
 *     return res
 * 
 * @delegate(["__smitokens", '__delitem__', "__getitem__", "__setitem__", "__iter__",             # <<<<<<<<<<<<<<
 *            "__reversed__", "__len__", "__str__", "pop", "append", "insert"])
 * class MetaMolecule(object):  # ex tokenlist
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_delegate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyList_New(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_u_smitokens_2);
  __Pyx_GIVEREF(__pyx_n_u_smitokens_2);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_smitokens_2);
  __Pyx_INCREF(__pyx_n_u_delitem);
  __Pyx_GIVEREF(__pyx_n_u_delitem);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_u_delitem);
  __Pyx_INCREF(__pyx_n_u_getitem);
  __Pyx_GIVEREF(__pyx_n_u_getitem);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_u_getitem);
  __Pyx_INCREF(__pyx_n_u_setitem);
  __Pyx_GIVEREF(__pyx_n_u_setitem);
  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_u_setitem);
  __Pyx_INCREF(__pyx_n_u_iter);
  __Pyx_GIVEREF(__pyx_n_u_iter);
  PyList_SET_ITEM(__pyx_t_7, 4, __pyx_n_u_iter);
  __Pyx_INCREF(__pyx_n_u_reversed);
  __Pyx_GIVEREF(__pyx_n_u_reversed);
  PyList_SET_ITEM(__pyx_t_7, 5, __pyx_n_u_reversed);
  __Pyx_INCREF(__pyx_n_u_len);
  __Pyx_GIVEREF(__pyx_n_u_len);
  PyList_SET_ITEM(__pyx_t_7, 6, __pyx_n_u_len);
  __Pyx_INCREF(__pyx_n_u_str);
  __Pyx_GIVEREF(__pyx_n_u_str);
  PyList_SET_ITEM(__pyx_t_7, 7, __pyx_n_u_str);
  __Pyx_INCREF(__pyx_n_u_pop);
  __Pyx_GIVEREF(__pyx_n_u_pop);
  PyList_SET_ITEM(__pyx_t_7, 8, __pyx_n_u_pop);
  __Pyx_INCREF(__pyx_n_u_append);
  __Pyx_GIVEREF(__pyx_n_u_append);
  PyList_SET_ITEM(__pyx_t_7, 9, __pyx_n_u_append);
  __Pyx_INCREF(__pyx_n_u_insert);
  __Pyx_GIVEREF(__pyx_n_u_insert);
  PyList_SET_ITEM(__pyx_t_7, 10, __pyx_n_u_insert);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_11) {
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_9);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_7};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_7};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":160
 * @delegate(["__smitokens", '__delitem__', "__getitem__", "__setitem__", "__iter__",
 *            "__reversed__", "__len__", "__str__", "pop", "append", "insert"])
 * class MetaMolecule(object):  # ex tokenlist             # <<<<<<<<<<<<<<
 *     """class MetaMolecule.
 *     This class uses the PLY based lexer and parser.
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_iso885915_MetaMolecule, __pyx_tuple__37, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iso885915_MetaMolecule, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1090
 * # end of class MetaMolecule
 * #-------------------------------------------------------------------------------
 * def adj2dist(Mnadj, MDist, ind, ll):             # <<<<<<<<<<<<<<
 *     res = True
 *     for i in range(ll):
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_7adj2dist, 0, __pyx_n_s_adj2dist, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_adj2dist, __pyx_t_6) < 0) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1101
 * 
 * #-------------------------------------------------------------------------------
 * def isSmiles(value):             # <<<<<<<<<<<<<<
 *     try:
 *         MetaMolecule(value)
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_9isSmiles, 0, __pyx_n_s_isSmiles, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isSmiles, __pyx_t_6) < 0) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1108
 *         return False
 * 
 * def isInt(val):             # <<<<<<<<<<<<<<
 *     try:
 *         int(val)
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8metaphor_7chem_gm_4core_12metamolecule_11isInt, 0, __pyx_n_s_isInt, NULL, __pyx_n_s_metaphor_chem_gm_core_metamolecu, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isInt, __pyx_t_6) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "metaphor/chem_gm/core/metamolecule.py":1116
 * 
 * #-------------------------------------------------------------------------------
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     import sys
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_12) {

    /* "metaphor/chem_gm/core/metamolecule.py":1117
 * #-------------------------------------------------------------------------------
 * if __name__ == "__main__":
 *     import sys             # <<<<<<<<<<<<<<
 * 
 *     name =  "m_toluic acid0"
 */
    __pyx_t_6 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_6) < 0) __PYX_ERR(0, 1117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1119
 *     import sys
 * 
 *     name =  "m_toluic acid0"             # <<<<<<<<<<<<<<
 *     smiles = "Cc1cc(C(O)=O)ccc([H:1])1"
 * 
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_kp_u_m_toluic_acid0) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":1120
 * 
 *     name =  "m_toluic acid0"
 *     smiles = "Cc1cc(C(O)=O)ccc([H:1])1"             # <<<<<<<<<<<<<<
 * 
 *     mol = MetaMolecule(smiles, name)
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_smiles, __pyx_kp_u_Cc1cc_C_O_O_ccc_H_1_1) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)

    /* "metaphor/chem_gm/core/metamolecule.py":1122
 *     smiles = "Cc1cc(C(O)=O)ccc([H:1])1"
 * 
 *     mol = MetaMolecule(smiles, name)             # <<<<<<<<<<<<<<
 * 
 *     print(mol)
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iso885915_MetaMolecule); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_smiles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_mol, __pyx_t_1) < 0) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1124
 *     mol = MetaMolecule(smiles, name)
 * 
 *     print(mol)             # <<<<<<<<<<<<<<
 *     for tok in mol:
 *         print( tok)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_mol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1125
 * 
 *     print(mol)
 *     for tok in mol:             # <<<<<<<<<<<<<<
 *         print( tok)
 *     # 'C1=CC=C-C=C1CC', 'MyMolecule'
 */
    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_mol); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_14(__pyx_t_1);
        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, 1125, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_tok, __pyx_t_9) < 0) __PYX_ERR(0, 1125, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1126
 *     print(mol)
 *     for tok in mol:
 *         print( tok)             # <<<<<<<<<<<<<<
 *     # 'C1=CC=C-C=C1CC', 'MyMolecule'
 * #     smiles = 'CC(=O)c1c(C)cc(C)cc1C'
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_tok); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "metaphor/chem_gm/core/metamolecule.py":1125
 * 
 *     print(mol)
 *     for tok in mol:             # <<<<<<<<<<<<<<
 *         print( tok)
 *     # 'C1=CC=C-C=C1CC', 'MyMolecule'
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1153
 * #     for token in mol:
 * #         print(token)
 *     print('done')             # <<<<<<<<<<<<<<
 * 
 * #     print("running smi_parser\n")
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "metaphor/chem_gm/core/metamolecule.py":1116
 * 
 * #-------------------------------------------------------------------------------
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     import sys
 * 
 */
  }

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

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

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init metaphor.chem_gm.core.metamolecule", 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.metamolecule");
  }
  __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

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

/* PyObjectFormatAndDecref */
    static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
    static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

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

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(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 = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #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_remainder(op1, op2);
            }
        }
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

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

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

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

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

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

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

/* None */
      static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

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

/* SaveResetException */
      #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if PY_VERSION_HEX >= 0x030700A3
    *type = tstate->exc_state.exc_type;
    *value = tstate->exc_state.exc_value;
    *tb = tstate->exc_state.exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = type;
    tstate->exc_state.exc_value = value;
    tstate->exc_state.exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
      #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
      #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = local_type;
    tstate->exc_state.exc_value = local_value;
    tstate->exc_state.exc_traceback = local_tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

/* SwapException */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A3
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = *type;
    tstate->exc_state.exc_value = *value;
    tstate->exc_state.exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

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

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

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

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

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

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

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

/* None */
            static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

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

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

/* pop_index */
            static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(0 <= cix && cix < size)) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            Py_SIZE(L) -= 1;
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* UnpackUnboundCMethod */
            static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
    }
#endif
    return 0;
}

/* CallUnboundCMethod2 */
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod1 */
            #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* py_dict_pop */
            static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
    if ((1)) {
        return _PyDict_Pop(d, key, default_value);
    } else
#endif
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key);
    }
}

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

/* PyObject_GenericGetAttrNoDict */
            #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

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

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

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

/* CoroutineBase */
            #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    if (self->exc_type) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
    if (likely(self->exc_traceback)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
                static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
                #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
                static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
                static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
                static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
